Help with 3rd person camera theory
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?
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
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
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
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
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement
Recommended Tutorials
Advertisement