RE: [Algorithms] Up Vector in Projection Matrix
Brought to you by:
vexxed72
From: Kelmenson, D. <Dan...@br...> - 2000-08-09 21:35:47
|
> -----Original Message----- > From: Pai-Hung Chen [mailto:pa...@ac...] > > > > > 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. > > That explains everything (though I don't know why/how the > underlying math > works). An ever-confusing question got explained! Thanks a lot! :-) > The most likely reason the math worked (the reason the math worked in my program, and most likely in yours...) is that the main use of the 'up' vector is crossing it with the forward/view direction. As long as your character/camera doesn't lean to the side, the true (0,1,0) up vector and the actual perpendicular-to-forward up vector will both be coplanar with the forward vector, and therefore give you the same cross product. Dan Kelmenson Mattel Interactive |