PDA

View Full Version : Location of object?



phenius
04-29-2001, 08:37 AM
Hey I'm a newbie at OpenGL. I've got a SolidSphere in space somewhere, but I can't seem to find where it is?? How can I find out where OpenGL placed the sphere when I created it? Here's some of my code :


float a,b,c=0.0;
float d,e=0.0;
float f=-5.0;
float g=0.0;
float h=1.0;
float i=0.0;

glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
glMatrixMode(GL_MODELVIEW);
glPushMatrix();
gluLookAt(a,b,c,d,e,f,g,h,i);
glutSolidSphere(1.0, 20.0, 16.0);
glPopMatrix();

Does any one know where my sphere is http://www.opengl.org/discussion_boards/ubb/frown.gif ??

Thanks a lot!!!

-Ian

Korval
04-29-2001, 08:49 AM
The sphere is at the origin. Since the camera is at the origin, you are inside the sphere.

Change your gluLookAt call so that you are at, say, 40 units away from the origin.