1

I've been doing some research recently on how to draw a sphere using OpenGL on Android. From what I gather, it seems there are many different answers:

  • Create a square and draw a sphere over it with ray-traced impostors. Drawing a sphere in OpenGL ES

  • Use blender and create a sphere there, then use that .obj file in the application

  • Create a square and texture it with a circle image with appropriate shading

  • Natively draw the sphere

... So my question is, what is "best practice"? I am familiarizing myself with opengl and can create squares easily enough, but is it worth the time (and gpu) to learn how to natively create the sphere?

Community
  • 1
  • 1
sam
  • 430
  • 4
  • 13
  • There is no "best practice". But there's no difference between #2 and #4. – Nicol Bolas Jul 29 '13 at 14:18
  • @NicolBolas by natively draw the sphere I meant creating a sphere object with opengl within the android application – sam Jul 29 '13 at 14:25
  • I know what you meant, and my point still stands. OpenGL doesn't care where you get a mesh from. It doesn't care if you create one out of nothing or load it off of disk. All it cares about is that you have a buffer object with some vertex data in it. #2 and #4 are the same thing to the GPU. – Nicol Bolas Jul 29 '13 at 14:35

1 Answers1

2

The best approach is to use Blender. Here's why. Once you implement the code to read and parse vertex data from a POD/Collada/Obj file for OpenGL ES you will have a tool that can render any shape you can create in Blender and that is very powerful. This is the fundamental basis of a game engine; it enables professional content creation tools. And there are some open source SDKs out there (PowerVR) that already provide the basic pieces, plus handling textures and animations too.

ClayMontgomery
  • 2,786
  • 1
  • 15
  • 14