Sign in to follow this  

Third Person Camera Help

Recommended Posts

Urgent! I need help with the game im developing.

Basically, its supposed to be a game with third person camera . This means that the camera will revolve around an object with the movement of the mouse.

So far I have these:
- an object (to be focused by the camera)
- a camera that moves according to the mouse movement (like an fps).
- a variable that holds the distance between the camera and the object.

the methods used in order to move objects and the camera are as follows:

To move objects I use:
[b] translate(float x, float y, float z)[/b] <--this method will move the object position by adding the vector passed into the object's(or camera's) current position. So basically, if I have an object in (1,1,1) and I translate it by (0,5,2), the object's new posision will be at (1,6,3).

To rotate objects I use:
[b] rotatex(float rad), rotatey(float rad), rotatez(float rad) [/b]<--- These methods rotate objects according to the axis. So basically, calling rotatey() of an object will make it rotate like how your neck moves when trying to say "no".

The game I'm working on is using the DirectX sdk and is programmed in C++

Hopefully, someone out there can help me. I'd be very very thankful.

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