Jump to content
Xtreme .Net Talk

Recommended Posts

Posted

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

Posted
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.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...