Re: [Algorithms] Up Vector in Projection Matrix
Brought to you by:
vexxed72
From: Stephen J B. <sj...@li...> - 2000-08-09 20:18:01
|
On Wed, 9 Aug 2000, Pai-Hung Chen wrote: > I am manipulating projection matrix in my D3D program so that the player can > lift up/down his head to view the world. I do modify the viewing-direction > component of the projection matrix but always leave the "up-direction" > component as (0, 1, 0). I think this should not work theoretically (at > least introduce some weird effect). However, it DOES work even I don't > modify the "up-direction" component (such that it is perpendicular to the > "viewing-direction"). I'm no D3D expert - but I'll presume this is similar to the OpenGL 'glLookAt' stuff. When you specify a point or direction to "look at", you have only specified two of the degrees of freedom of the system. That object could be in the middle of the screen - either upside-down - or right way up - or at any 'roll' angle in between. The 'up' vector only has to be enough to resolve that issue - and only one of its degrees of freedom is needed. Hence, there are a wide variety of vectors that will do the job. The only constraint is that the up vector and the 'look direction' are not parallel. Hence, so long as your character can't look absolutely vertically upwards or absolutely vertically downwards, an 'up' vector of (0,1,0) will do fine. Steve Baker (817)619-2657 (Vox/Vox-Mail) L3Com/Link Simulation & Training (817)619-2466 (Fax) Work: sj...@li... http://www.link.com Home: sjb...@ai... http://web2.airmail.net/sjbaker1 |