#### Archived

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

# camera nav or not?

This topic is 6095 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

## Recommended Posts

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 on other sites
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.

##### Share on other sites
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.

1. 1
2. 2
Rutin
18
3. 3
4. 4
5. 5

• 14
• 12
• 9
• 12
• 37
• ### Forum Statistics

• Total Topics
631431
• Total Posts
3000040
×