Why / how does XNA's right-handed coordinate system effect anything if you can specify near/far Z values?

Posted by vargonian on Game Development See other posts from Game Development or by vargonian
Published on 2011-01-01T23:59:09Z Indexed on 2011/01/02 0:59 UTC
Read the original article Hit count: 669

Filed under:
|
|
|

I am told repeatedly that XNA Game Studio uses a right-handed coordinate system, and I understand the difference between a right-handed and left-handed coordinate system. But given that you can use a method like Matrix.CreateOrthographicOffCenter to create your own custom projection matrix, specifying the left, right, top, bottom, zNear and zFar values, when does XNA's coordinate system come into play?

For example, I'm told that in a right-handed coordinate system, increasingly negative Z values go "into" the screen. But I can easily create my projection matrix like this:

Matrix.CreateOrthographicOffCenter(left, right, bottom, top, 0.1f, 10000f);

I've now specified a lower value for the near Z than the far Z, which, as I understand it, means that positive Z now goes into the screen. I can similarly tweak the values of left/right/top/bottom to achieve similar results.

If specifying a lower zNear than zFar value doesn't affect the Z direction of the coordinate system, what does it do? And when is the right-handed coordinate system enforced?

The reason I ask is that I'm trying to implement a 2.5D camera that supports zooming and rotation, and I've spent two full days encountering one unexpected result after another.

© Game Development or respective owner

Related posts about XNA

Related posts about 3d