Camera Position
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.
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.
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.
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.
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement
Recommended Tutorials
Advertisement