DX View Matrix

liquid8

Freshman
Joined
Jan 14, 2003
Messages
31
I am just learning D3D and I am having trouble getting the view matrix that I want. I have a mesh loaded at an X,Y,Z point. What I want to do is using a rotational view matrix that will rotate around the mesh. The rotation matrices (rotationX, rotationY, rotationZ) it seems only allow you to rotate from the camera angle, and not specify the rotational point. Any ideas what I am doing wrong?

I did try adding a lookatLH matrix and a rotational matrix and it worked (sortof) but did some strange stuff to my model.

LiQuiD8
 
Create a translation matrix that will translate the world such that your mesh is now at the origin, then multiply that by your rotation matrix, then multiply the result by a translation matrix that will move the mesh back to its desired position. The resulting matrix will be what you want.
 
Back
Top