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

Started by
6 comments, last by JohnBolton 18 years, 1 month ago
Is the up vector always {0, 1, 0}, pointing in the positive Y axis? Thanks a bunch for any clarification!
A JPEG is worth a thousand and twenty four DWORD's. ;)
Note: Due to vacationing my website will not be updated till late-August. Of course I still have internet, but who wants to program during a vacation?
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.
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
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
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.
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.
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!
A JPEG is worth a thousand and twenty four DWORD's. ;)
Note: Due to vacationing my website will not be updated till late-August. Of course I still have internet, but who wants to program during a vacation?
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.
John BoltonLocomotive Games (THQ)Current Project: Destroy All Humans (Wii). IN STORES NOW!

This topic is closed to new replies.

Advertisement