Jump to content
  • Advertisement
Fadey Duh

Opengl. X, Y, Z only that Y is up/down.

Recommended Posts

I tend to see a top-down camera as the default camera.  Therefore:

  • In world coordinates, x is east-west, y is north-south, and z is up-down.
  • In screen coordinates, x is left-right, y is up-down, and z is forward-back.
  • In the default top-down camera, world x maps to screen x, world y maps to screen y, and world z maps to screen z.
  • The camera can be moved and rotated arbitrarily, which means that usually there is no direct mapping from world coordinates to screen coordinates.

Using y for world up-down is just weird, because the up-down axis is obviously the "special" one and therefore it should not sit between the other two axes.  Likewise, using any camera orientation other than top-down as the default is just weird, because I always plan out my 3D spaces starting with a 2D top-down map.

Share this post


Link to post
Share on other sites
Advertisement
Posted (edited)

What’s stopping you from still using zup?

 

all of my games that I write in OpenGL are built on the idea that the zaxis is the up axis.

 

its all in the view matrix.

Edited by orange451

Share this post


Link to post
Share on other sites
51 minutes ago, orange451 said:

What’s stopping you from still using zup?

 

all of my games that I write in OpenGL are built on the idea that the zaxis is the up axis.

 

its all in the view matrix.

That is true but doesn't we need to perform extra calculation to get that zup?
My theory of just rotation screen roll way did not made sense it appeared. I'm still down for getting zup if there
is a way to get it done without extra performance nor writing my own matrix library. I'm using qt.

Share this post


Link to post
Share on other sites
2 hours ago, Fadey Duh said:

That is true but doesn't we need to perform extra calculation to get that zup?
My theory of just rotation screen roll way did not made sense it appeared. I'm still down for getting zup if there
is a way to get it done without extra performance nor writing my own matrix library. I'm using qt.

I'm not familiar with qt, but generally speaking, choice of coordinate system convention isn't a performance issue. At most it might lead to a couple extra math operations per frame (and it might not even require that).

As for having to write your own math code, if the framework you're using doesn't completely abstract away the underlying math, and if the math library you're using provides even the most basic matrix functionality (such as matrix multiplication and the ability to set matrix elements directly), you should be able to do it. (Getting the math right is of course a separate issue.)

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Advertisement
×

Important Information

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

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!