• Advertisement
Sign in to follow this  

Camera pointing to -Z

This topic is 1978 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Why are cameras usualy implemented pointing to -Z direction, not Z? Is there any technical background behind this or its just an unformal convection?

Share this post


Link to post
Share on other sites
Advertisement
It has to do with the right-handed coordinate system, positive x and y point right and up respectively and negative z points forward. In a left-handed coordinate system positive z points forward. I believe OpenGL uses a right-handed and DirectX a left-handed coordinate system.

Share this post


Link to post
Share on other sites
Mussi is right, and it is semantically easier to understand that the Near Plane (z=0) is the plane of your screen and the Far Plane is "deeper" in the screen.
Because in OpenGL and many other 3D API's the z direction is positive pointing out of the screen, we adopt a -z direction as the look-at direction.

Share this post


Link to post
Share on other sites
Ok, as far as I understand when camera is pointing -Z direction its actually shows whats behind it, right? `Looking directions' is also reversed. Does that mean the OpenGL depth test parameters should be like:
glDepthFunc(GL_GEQUAL);
glClearDepth(0.0f);
?

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement