6

I'm quite new to animations in Android. For 3D animations I have to use OpenGL to make it look more fluid.

Is it possible to convert a Drawable that is i draw some rectangle or circle on a canvas and i want that to convert into a View using OpenGL. Is that possible and if so then how?

Can anyone please let me know what does the first point in the FEATURES say in this URL http://developer.android.com/reference/android/opengl/GLSurfaceView.html

genpfault
  • 51,148
  • 11
  • 85
  • 139
Lavanya
  • 3,903
  • 6
  • 31
  • 57

2 Answers2

3

OpenGL doesn't operate on that level. OpenGL is just a drawing API, giving you "pens and brushes" to draw on some canvas provided by the operating system. Any OS specific concepts like Drawables and Views are out of the scope of OpenGL and won't be dealt with by it.

However maybe if you described in detail what it is you want to achieve we may be able to help.

datenwolf
  • 159,371
  • 13
  • 185
  • 298
  • i want to draw a shape say some rectangle or circle on screen and then convert it into a view. Is that possible? – Lavanya Jul 01 '11 at 08:37
  • can you please tell me wat does the first point in the Features describe in this url http://developer.android.com/reference/android/opengl/GLSurfaceView.html – Lavanya Jul 01 '11 at 08:41
  • For just drawing rectangles/circles you can create a custom Android view and draw stuff in the onDraw function. GLSurfaceView is a wrapper for rendering 3D graphics. – Abhinav Jul 01 '11 at 10:28
  • after drawing that i want to convert into a view... will that be possible? – Lavanya Jul 01 '11 at 10:36
  • All the drawing will happen inside a View which can be used like any other View in Android. – Abhinav Jul 01 '11 at 10:44
  • Hello, i have one ImageView and i want draw something on image using OpenGL like as 3D effect on Touch Position, so plz can you help me for it – Niranj Patel Jul 02 '11 at 05:09
  • @CapDroid check this http://stackoverflow.com/questions/5990578/detect-touch-on-opengl-object – Lavanya Jul 02 '11 at 06:21
3

Well, you can try to convert a Drawable to a bitmap and then map this bitmap on a 3D surface in OpenGL as a texture.

Community
  • 1
  • 1
Abhinav
  • 38,516
  • 9
  • 41
  • 49