Advertisement

Camera Position

Started by September 26, 2002 10:21 AM
2 comments, last by arkansas 22 years, 5 months ago
Hi I drew a Coordinate System with a x,y, and z axes. Just for better orientation. I translated it back to z= -100. How do I have to set the camera points to look at it from the front. Like u start the prog without camera settings, I can see it exactly from the front. But it ain''t working with the camera. I don''t understand why. Please help me. THX arkansa
I''m not exactly sure what you''re talking about but...

Do you mean nothing is drawn on the screen?
-> z= -100 is a pretty big number, maybe it is too much (beyond back clipping plane, so it draws nothing further than that.
-> Do you forget to call glLoadIdentity() before each frame? without that, your things will go further into the screen, very very fast.

Or the picture is just weird?
-> gluLookAt(..) is the function used to set up "camera". Since there''s no camera object in openGL. This function just do all the tranformation stuff for you.. just a bunch of glTranslate & glRotate (That''s why it is in glu).

Can you explain the situation, more in details?
I don''t know what you mean by "working with the camera", though.
Advertisement
hey

ok, I drew three lines:

glTranslatef(0.0f,0.0f,-100.0f);
glBegin(GL_LINES);
glColor3f(0.0f,0.0f,1.0f);
glVertex3f(-100.0f,0.0f,0.0f);
glVertex3f(100.0f,0.0f,0.0f);

glColor3f(0.0f,1.0f,0.0f);
glVertex3f(0.0f,-100.0f,0.0f);
glVertex3f(0.0f,100.0f,0.0f);

glColor3f(1.0f,0.0f,0.0f);
glVertex3f(0.0f,0.0f,-100.0f);
glVertex3f(0.0f,0.0f,100.0f);
glEnd();

But when I set the camera it only shows a part of a line or even nothing.
doesnt have to be the problem, but make sure that your camera isnt too far away from the object. when you call gluPerspective( bla,bla ) you set a view distance. everything that is outside this distance will not appear on the screen

This topic is closed to new replies.

Advertisement