Gamestudio Links
Zorro Links
Newest Posts
Zorro 2.70
by jcl. 09/29/25 09:24
optimize global parameters SOLVED
by dBc. 09/27/25 17:07
ZorroGPT
by TipmyPip. 09/27/25 10:05
assetHistory one candle shift
by jcl. 09/21/25 11:36
Plugins update
by Grant. 09/17/25 16:28
AUM Magazine
Latest Screens
Rocker`s Revenge
Stug 3 Stormartillery
Iljuschin 2
Galactic Strike X
Who's Online Now
1 registered members (TipmyPip), 18,449 guests, and 6 spiders.
Key: Admin, Global Mod, Mod
Newest Members
krishna, DrissB, James168, Ed_Love, xtns
19168 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
trying to set up 3rd person camera #250765
02/09/09 17:02
02/09/09 17:02
Joined: Sep 2002
Posts: 199
Chicago, Illinois
Thehawk Offline OP
Member
Thehawk  Offline OP
Member

Joined: Sep 2002
Posts: 199
Chicago, Illinois
Hey guys,

I'm trying to set up a third person camera. I have the desired effect going. The camera starts behind the player, however when the player turns/pans the camera does not pan with the player. How can I get the camera to pan when the player moves from left to right? here's my code:

vec_set(camera.x, player.x ); // rotate the camera towards player's ship all the time
camera.x -= 100;
camera.z += 27;
vec_sub(temp, camera.x);
vec_to_angle(camera.pan, player.pan);


I appreciate any help you can provide.

Re: trying to set up 3rd person camera [Re: Thehawk] #250771
02/09/09 17:35
02/09/09 17:35
Joined: Oct 2008
Posts: 67
C
Crypton Offline
Junior Member
Crypton  Offline
Junior Member
C

Joined: Oct 2008
Posts: 67
http://www.coniserver.net/ubb7/ubbthreads.php?ubb=showflat&Number=250560#Post250560
If watched or searched for.

But I'd use (as in above link) sin() and cos() to calculate angular positions (if the term is correct :P)

Cheers!


New into Gamestudio and eager to learn it..
Stuff and games done in 2D: LINK
Re: trying to set up 3rd person camera [Re: Thehawk] #251015
02/11/09 08:40
02/11/09 08:40
Joined: Aug 2003
Posts: 2,011
Bucharest, Romania
George Offline

Expert
George  Offline

Expert

Joined: Aug 2003
Posts: 2,011
Bucharest, Romania
This should work (put the code inside a while loop):

vec_set (camera.x, vector (-200, 0, 50)); // play with these values
vec_rotate (camera.x, player.pan);
vec_add (camera.x, player.x);
camera.pan = player.pan;


Gamestudio download | Zorro platform | shop | Data Protection Policy

oP group Germany GmbH | Birkenstr. 25-27 | 63549 Ronneburg / Germany | info (at) opgroup.de

Powered by UBB.threads™ PHP Forum Software 7.7.1