x z grid confusion

Started by
2 comments, last by tendifo 17 years, 10 months ago
I'm confused with something that probably has a very simple explanation. Back in the day, studying math, everyone knows how the x and y axis look on a piece of paper, x going to the right, y going towards the top of the page, perpendicular to x. I envision the x z plane similarly. I noticed that some quads that I was culling weren't appearing properly, and although I'm not sure if this problem is related, I noticed that what I would think would be vertex (1000,0), heading to the right on a piece of paper on the x axis, actually goes toward the top of the piece of paper, along what I would think is the z axis. This is totally confusing me. something like this, with a cube translated at (1000,0): cube is here | | | | | -------------------cube should be here | | | | | so am I right to assume that the xz plane actually is: X ^ | +, + | | --------------------->Z
Advertisement
          A Y          |          |          |          |          +------------>  X         /        /       /      v Z    A  Default view direction   /  /This is how the axes are defined in OpenGL.So this is what you see before any rotation/translation is done:     ^ Y     |   --+--> X     |

If you want to look at the xz plane, you should rotate your axes first, and then draw all the stuff at the wanted coordinates.

If you draw first, and then rotate the axes you get another result. In fact if you draw, then rotate and draw nothing after the rotation, the rotation had no effect on the code. My guess is that this is what went wrong. Typical translate-rotate-draw order confusion.
thx for your response. so far all my problems have been 'typical'. I guess that is a good thing.

You can orient the x, y, and z axis so x and y act as the ground. Then you can use them like normal 2d coordinates:
      | Z    / Y      |    /      |  /      |/________ X

This topic is closed to new replies.

Advertisement