Archived

This topic is now archived and is closed to further replies.

kayX

camera nav or not?

Recommended Posts

kayX    152
i am currently trying to make a simulation game. i use the eye point and look at point to navigate and its fine until i wanted a rotation in the z-axis Is there a way to do so with this technique or im using a wrong technique? please help

Share this post


Link to post
Share on other sites
_stalker    122
View matrix consists of EyePoint, LookPoint, and UpVector
Did you try to change your UpVector to something like D3DXVECTOR3(sin(b), 0, cos(b)), where b is the rotation angle.

Hope this will be helpfull.

Share this post


Link to post
Share on other sites
CrazedGenius    156
The view matrix is a way of describing the position and orientation of the camera. A matrix can be derived from an eyepoint, etc. but those features are not an explicit part of the matrix.

I prefer to think in terms of the camera position and orientation. FOr instance, "I am at X, Y, Z and at certain angles a, b, c" vs. "I am at X, Y, Z and looking at x2, y2, z2"

The position / orientation way is much more straightforward. If I am on a street corner facing north, it''s much easier to say that than to say I''m on a street corner and then figuring out a point to the north of me to serve as a lookat point.

The matrix is very easy.
compute the matrix for rotations
compute the matrix for translation
mat = rot * trans (ORDER MATTERS!)
set the view transform to mat.

Share this post


Link to post
Share on other sites