Take the 2-minute tour ×
Game Development Stack Exchange is a question and answer site for professional and independent game developers. It's 100% free, no registration required.

I am using a right handed coordinate system for my world coordinates (so, positive x goes right, y is up, and z is towards you).

However, after projection and the w divide, nomalised device coordinates range from [-1,1] on x and y, with x pointing right, and y pointing up, and z ranging [0,1] (or [-1,1] in OpenGL) pointing into the screen. This is a left handed coordinate system.

As such, wouldn't the winding order you need to use swap? If my models define front faces using clockwise winding, then it would seem that you must cull clockwise faces in order for the hidden faces to be removed after projection. I don't remember having to do this in XNA (where I wasn't calculating my own matrices and just left the defaults), so have I made a mistake in my reasoning here?

share|improve this question
Can you post, how you create projection matrix? –  zacharmarz Feb 24 '12 at 11:57
@zacharmarz I am using the code from geeks3d.com/20090729/… –  Aphid Feb 24 '12 at 12:50
And can't be your problem with view matrix? Can you write, how you construct it? –  zacharmarz Feb 24 '12 at 13:08
Is there an actual problem you're trying to solve or is this just curiosity about the full pipeline? –  Patrick Hughes Feb 24 '12 at 18:48
add comment

1 Answer

up vote 4 down vote accepted

First of all, X points right, not left, in screen coordinates. But yes, the normalized device coordinates are a left-handed system. It doesn't matter for backface culling, though. From the OpenGL FAQ:

OpenGL face culling calculates the signed area of the filled primitive in window coordinate space. The signed area is positive when the window coordinates are in a counter-clockwise order and negative when clockwise.

It only looks at the triangle in 2D, so if it's anticlockwise-wound in right-handed space before perspective projection, it'll still be anticlockwise-wound afterward; the reflection through the screen plane doesn't affect it. I assume D3D behaves similarly.

share|improve this answer
Ah yes, I meant to say x points right, I'll fix that in the question. But yes, I was for some reason thinking the projection matrix is doing the left/right swap by negating the x axis, which it doesn't. Negating the z axis wouldn't effect the winding order, as you say. –  Aphid Feb 26 '12 at 12:09
add comment

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.