3D spheres in windows

Open GL
I am using .NET open GL to try to draw a series of placed solid spheres in 3 dimensions onto a plane. However am having trouble doing this. I am using the standard opengl routines which have been ported over to windows and the glut library. I need to be able to use the routines glutsolidsphere to draw a sphere at a particular place in 3D. I need light to be abl to show that these sphere (I need to draw maybe 400) are in the right place. I just cant find the code to

  1. position the sphere where I need it
  2. put correct lighting effects on it.

Any help with example code would be gratefully recieved.

Since these are very basic things you should consider reading a book about opengl. (Earlier versions of the Redbook are available online. )

The answers to your questions are described in “Chapter 3: Viewing”, section “The Modeling Transformation” (hint: glTranslatef ) and in “Chapter 6: Lighting”.

If you have trouble understanding any of these concepts also look at these very helpful interactive examples!

This topic was automatically closed 183 days after the last reply. New replies are no longer allowed.