• Advertisement
Sign in to follow this  

Up vector???????????

This topic is 4401 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

Advertisement
Quote:
Original post by geekalert
Is the up vector always {0, 1, 0}, pointing in the positive Y axis? Thanks a bunch for any clarification!
More context would be helpful, but the short answer is that the 'up vector' is whatever you want it to be. Most commonly though it is the positive Y or Z axis.

Share this post


Link to post
Share on other sites
No.

The up vector is the cross-product of the forward and strafe vectors of an object. If you imagine an airplane banking in a turn, it's up vector is pointing from the center of the plane towards the roof. Similarly if you want to roll your camera, the up vector will change

-me

Share this post


Link to post
Share on other sites
Quote:
Original post by Palidine
The up vector is the cross-product of the forward and strafe vectors of an object. If you imagine an airplane banking in a turn, it's up vector is pointing from the center of the plane towards the roof. Similarly if you want to roll your camera, the up vector will change


But then again, many apps define a global "up" as (0,1,0) that is used to find the local coordinate system.

The procedure is (from memory):

direction of movement x global up = right
right x direction of movement = local up

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
Quote:
Original post by Palidine
No.

The up vector is the cross-product of the forward and strafe vectors of an object. If you imagine an airplane banking in a turn, it's up vector is pointing from the center of the plane towards the roof. Similarly if you want to roll your camera, the up vector will change

-me


That's the LOCAL up vector that changes as an object changes. The WORLD up vector will generally stay the same. It varies by engine, but is usually Z or Y, the sign also varies by engine.

Share this post


Link to post
Share on other sites
Quote:
Original post by jyk
More context would be helpful, but the short answer is that the 'up vector' is whatever you want it to be. Most commonly though it is the positive Y or Z axis.
Just to clarify, my answer was in reference to the 'global' up vector for the simulation.

Share this post


Link to post
Share on other sites
Thanks for all your advice! The context is OpenAL, so I suppose the up vector doesn't really matter (I believe sounds should sound the same, rotated or not). But just in case I will add the crossproduct code to my game engine - foresight is better than hindsight!

Share this post


Link to post
Share on other sites
Quote:
Original post by geekalert
The context is OpenAL, so I suppose the up vector doesn't really matter (I believe sounds should sound the same, rotated or not). But just in case I will add the crossproduct code to my game engine - foresight is better than hindsight!


The "up" vector is whatever direction is "up" in your world. In some games, the Y axis is up. In some games, the Z axis is up. There are even some games where the -Z axis is up. Some games (such as space simulations) might not have an up direction.

Share this post


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

  • Advertisement