camera nav or not?
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
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.
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.
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.
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.
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement