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

Suppose I have a world defined in typical OpenGL coords.. then the up vector defined for this space is (0,1,0).

Now, if I load a model that is defined with (0,0,1) as its up vector, what are the matrix operation(s) that I need to carry out here to arrive at the 4x4 transformation matrix for the model?

Many thanks.

share|improve this question

The up vector being different basically means that the model is in a different space, where Z inwards represents that what you regard as Y up. To compensate for this, rotate the model vertices 90 degrees over the X-axis (in the right direction). Draw the axes on paper, it'll be clear in a jiffy.

Think of it as this: if you were to rotate the up vector 0, 0, 1 -- how would you do it to make it 0, 1, 0?

Use Google for all about building rotation matrices. Or use glRotate() for a quick test.

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.