# x z grid confusion

This topic is 4593 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

## Recommended Posts

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

##### Share on other sites
          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.

##### Share on other sites
thx for your response. so far all my problems have been 'typical'. I guess that is a good thing.

##### Share on other sites
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

• ### What is your GameDev Story?

In 2019 we are celebrating 20 years of GameDev.net! Share your GameDev Story with us.

(You must login to your GameDev.net account.)

• 15
• 9
• 11
• 9
• 9
• ### Forum Statistics

• Total Topics
634134
• Total Posts
3015749
×