3

I have been asked to do 3D sphere and adding textures to it so that it looks like different planets in the Solar System. However 3ds max was not mentioned as mandatory.

So, how can I make 3D spheres using OpenGL and add textures to it? using glutsphere or am I suppose to do it some other method and how to textures ?

noob
  • 83
  • 1
  • 1
  • 4

2 Answers2

3

The obvious route would be gluSphere (note, it's glu, not glut) with gluQuadricTexture to get the texturing done.

Jerry Coffin
  • 476,176
  • 80
  • 629
  • 1,111
2

I am not sure if glutSolidSphere has texture coordinates (as far as I can remeber they were not correct, or not existant). I remember that this was a great resource to get me started on the subject though: http://paulbourke.net/texture_colour/texturemap/

EDIT:

I just remembered that subdividing an icosahedron gives a better sphere. Also texture coordinates are easier to implement that way:

see here: http://www.gamedev.net/topic/116312-request-for-help-texture-mapping-a-subdivided-icosahedron/ and http://www.sulaco.co.za/drawing_icosahedron_tutorial.htm and http://student.ulb.ac.be/~claugero/sphere/

moka
  • 4,353
  • 2
  • 37
  • 63
  • Thanks for reply. Yeah I think 3ds is not needed it can be done without it using OpenGL which is good as I do not how to use 3ds max. – noob Aug 11 '11 at 09:08
  • I din't know about icosahedron, I saw some code on internet but not sure whether the author used that method or not. SO glusphere and icosahedron method are two best options ? – noob Aug 11 '11 at 09:24