liquid8 Posted November 3, 2003 Posted November 3, 2003 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 Quote
Optikal Posted November 3, 2003 Posted November 3, 2003 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. Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.