Jump to content
  • Advertisement
Sign in to follow this  
jtravers888

x z grid confusion

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

If you intended to correct an error in the post then please contact us.

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 this post


Link to post
Share on other sites
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.

Share this post


Link to post
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

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!