PDA

View Full Version : glutSolidSphere



Ali S. Alfaraj
09-25-2010, 04:31 AM
Hi friends,

I'm attempting to draw a ground with a light source in openGl.
I did draw the ground (a cube face on x-z plan).
I draw a solid sphere (glutSolidSphere) to represent the light source, and it is displayed at the center of the window screen, by default.
Now, I want to transform the sphere upwared so I can see the light reflection on the ground. How can I do that?

ViolentHamster
09-25-2010, 09:58 AM
glMatrixMode(GL_MODELVIEW);
glPushMatrix();
glTranslatef(0,y_translate,0);
glutSolidSphere();
glPopMatrix();

Note: This isn't really modern OpenGL. All these calls are deprecated from recent versions of OpenGL.

Ali S. Alfaraj
09-27-2010, 11:18 PM
Thanks for your helpful reply..:)

thaer89
09-28-2010, 07:09 AM
so how I can draw sphere with color on it on openGL 3.1 in easy way
or i had construct it by myself