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.

  • \$\begingroup\$ 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. \$\endgroup\$ Dec 5 '12 at 2:43
  • \$\begingroup\$ Yes, this is likely a result of handiness confusion. \$\endgroup\$
    – Jim
    Dec 5 '12 at 6:24
  • \$\begingroup\$ 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. \$\endgroup\$ Dec 5 '12 at 10:46
  • \$\begingroup\$ 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. \$\endgroup\$ Dec 5 '12 at 22:34

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.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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