#### Archived

This topic is now archived and is closed to further replies.

# Help with 3rd person camera theory

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

## Recommended Posts

I am making a tombraider/twisted metal/rune type game and I havent got a clue on how to rotate the world around the camera. I am thinking of doing some sort of tile based engine and when the player turns left or right I have to rotate the world left or right and I haven''t got the slightest clue on how to move and rotate all the tiles to their correct places.(excuse the huge run on sentence) I already figured out the trig math involved with figuring out how to move the player around according to the players heading. Now I need to figure out how to rotate the world according to the players heading so when I move the world the illusion looks right. (is this making any sense at all?) Can anyone help me out?

##### Share on other sites
OK. I''m like scared because of the treatment you gave newbie4ever.

Yes I do have some grasp on C/CPP and OpenGL. You can check out my latest game here
raptorgl

I''m not asking for code, I just need to know how a 3rd person camera works

##### Share on other sites
Here one idea:

Lets assume you keep track of your current players rotation in degrees. Lets say that the the variable RotY represents the rotation around the Y axis.

When you hit your moveing keys, your RotY variable changes.

Now all you have to do is when you draw your view, rotate the viewpoint RotY degrees, just like you would your player. Then move the camera out, and viola, you have your camera following your little guy.

Granted thats a simplified explanation but that''d do it.

There is a drawback with that thoguh, your camera will follow the man exactly. This will make it feel very quirky to the person playing it.

One way to fix this is to have a second variable, CameraRotY. So every frame you draw you would do this:

CameraRotY = 0.9 * CameraRotY + 0.1 * RotY;

This way, when your little guy rotates around, the camera will follow in a sluggish way.

These aren''t te ideal ways of doing, but they''re a good place to start.

Hope this helps,
Phillip Martin

##### Share on other sites
thanks! I will try that out

1. 1
2. 2
Rutin
21
3. 3
A4L
15
4. 4
5. 5
khawk
14

• 13
• 26
• 10
• 11
• 44
• ### Forum Statistics

• Total Topics
633741
• Total Posts
3013622
×