Sign in to follow this  

How can I make the Camera move around my Object

Recommended Posts

Me_Neo_Diehard    100
Hi all, I have a problem, and I really don't know how to solve it. Image hosted by 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
Moomin    332
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

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this