• Advertisement
Sign in to follow this  

How can I make the Camera move around my Object

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

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hi all, I have a problem, and I really don't know how to solve it. Image hosted by Photobucket.com I'm using C++ to buil the Camera. I can make it move around the origin, but I don't know how to make it move around the object. I'm using D3DXMatrixRotationAxis but the problem is the vector used in this function. (0,1,0) ---> RotationY. I really don't get it. PlZ give me any advice.

Share this post


Link to post
Share on other sites
Advertisement
Firstly I admit I know nothing about DirectX. However to answer your question all you have to do is subtract your view point from your position, then times your position by a matrix containing your rotation, then finally add your view point back on. The code should look something like this -

PositionVector -= ViewVector;
RotatedMatrix = MaxtrixRotation(x,y,z);
PositionVector = RotatedMatrix * PositionVector;
PositionVector += ViewVector;

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement