Jump to content

  • Log In with Google      Sign In   
  • Create Account

FREE SOFTWARE GIVEAWAY

We have 4 x Pro Licences (valued at $59 each) for 2d modular animation software Spriter to give away in this Thursday's GDNet Direct email newsletter.


Read more in this forum topic or make sure you're signed up (from the right-hand sidebar on the homepage) and read Thursday's newsletter to get in the running!


Camera pointing to -Z


Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
3 replies to this topic

#1 santa01   Members   -  Reputation: 307

Like
0Likes
Like

Posted 11 August 2012 - 06:02 PM

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

Sponsor:

#2 Mussi   Crossbones+   -  Reputation: 2105

Like
0Likes
Like

Posted 11 August 2012 - 06:39 PM

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.

#3 kuramayoko10   Members   -  Reputation: 386

Like
0Likes
Like

Posted 13 August 2012 - 10:43 AM

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.
Programming is an art. Game programming is a masterpiece!

#4 santa01   Members   -  Reputation: 307

Like
1Likes
Like

Posted 25 August 2012 - 09:03 AM

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);
?




Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.



PARTNERS