Game Development Community

How can i move a camera around a cylinder ?

by M. Stolley · in Torque Game Engine · 10/31/2005 (10:22 am) · 5 replies

Hi,

i want to make a game in TSE in which the player can control the camera with the arrow keys around a cylinder like object and look to the center.

So the up and down keys are for, ...

#1
10/31/2005 (10:29 am)
To make it clear, the cylinder should not be seen.
The cylinder should only be there to let the camera move around it.
The user then must always see what happen in the center.

Maybe there must not be a dif or dts cylinder for the camera to move along.
Maybe there is a mathematic formular for a cylinder on wich the camera can move.

Mathias
#2
10/31/2005 (10:35 am)
I used these two resources to get a 3rd-person "orbit-cam" that swivles/pans/tilts around the player, and allow me to control the player and camera separately. The end result is very similar to the Grand-Theft-Auto player/camera/control setup.

The one resource gives you a multitude of 3rd person cameras, I choose "orbit-cam". The other one is for building the correct 3rd person player controls independent of the camera.

This was all for TGE but it wasn't that hard to do and you could probably port it. If nothing else maybe it will give you some ideas. Good Luck.

http://www.garagegames.com/index.php?sec=mg&mod=resource&page=view&qid=5474
http://www.garagegames.com/index.php?sec=mg&mod=resource&page=view&qid=5471
#3
10/31/2005 (10:39 am)
The Advanced Camera Resource is a good place to look for how you can move the camera around. It also has an orbit mode that is very similar to what you are looking for in the cylinder.

You can also calculate the position of the camera around the center by the angle of rotation and use Sin and Cos to calculate the position of x and y respectively. The z value would just be a displacement.

The best thing would be to look at the Advanced Camera Resource to learn how the camera is moved and then modify the code to do what you want.
#4
10/31/2005 (10:39 am)
Thank you RavenSly3r and August Jokela.

I will look at them now.
#5
10/31/2005 (10:43 am)
Thank you RavenSly3r.

I will look at them now.