Public Group

# Up vector???????????

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

## Recommended Posts

Is the up vector always {0, 1, 0}, pointing in the positive Y axis? Thanks a bunch for any clarification!

##### Share on other sites
Quote:
 Original post by geekalertIs 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 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 on other sites
Quote:
 Original post by PalidineThe 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 on other sites
Quote:
 Original post by PalidineNo.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 on other sites
Quote:
 Original post by jykMore 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 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 on other sites
Quote:
 Original post by geekalertThe 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.

1. 1
Rutin
44
2. 2
3. 3
4. 4
5. 5

• 9
• 9
• 12
• 10
• 13
• ### Forum Statistics

• Total Topics
632983
• Total Posts
3009706
• ### Who's Online (See full list)

There are no registered users currently online

×