Game Development Stack Exchange is a question and answer site for professional and independent game developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I've got my project running and somehow it seems my vertex y components are inverted. 10 in the positive on Y goes down and 10 negative on the Y axis goes up.

I can't find anything with the initialization and I am not doing any negative scaling in the view matrix. I've never had something like this happen before, does anyone have some tips or things to look for ?

How I am sending verteces to the GPU ( Currently intermediate mode ) glVertex3f( x_pos_n, 10, z_pos );

I am using CG in the project but even without shaders the Y axis seems to be inverted.

share|improve this question
Coordinates are just numbers. Y being 'up' is simply a semantic you apply when drawing your vertices. I think that it's very likely you're building your View or Projection matrices wrong. Maybe your 'up' vector in the View matrix is (0, -1, 0), or you're using an RH Projection matrix with LH coordinates. – Panda Pajama Dec 5 '12 at 2:43
Yes, this is likely a result of handiness confusion. – Jim Dec 5 '12 at 6:24
My guess is that you've just been bitten by OpenGL's "bottom left is the origin" thing. I'm not going to go into whether or not that's most correct or most appropriate, but it is something that you need to be aware of, if you were expecting the opposite to be the case. – Le Comte du Merde-fou Dec 5 '12 at 10:46
Well I've found my current axis. X+ goes to the right, Z+ goes into the screen and Y+ goes downwards. This is neither a LH or RH system. I'm thinking of rewriting the camera although this one has worked in previous projects. – Yonathan Klijnsma Dec 5 '12 at 22:34
up vote 0 down vote accepted

Came down to my quaternion class not being right. I remove it and converted it all to the GLM math library. Works like a charm now, somehow I messed up going from quaternion to my view matrix.

share|improve this answer

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.