Gamestudio Links
Zorro Links
Newest Posts
New FXCM FIX Plugin
by flink. 06/04/24 07:30
AlpacaZorroPlugin v1.3.0 Released
by kzhao. 05/22/24 13:41
Free Live Data for Zorro with Paper Trading?
by AbrahamR. 05/18/24 13:28
Change chart colours
by 7th_zorro. 05/11/24 09:25
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
2 registered members (Akow, SBGuy), 1,423 guests, and 7 spiders.
Key: Admin, Global Mod, Mod
Newest Members
AemStones, LucasJoshua, Baklazhan, Hanky27, firatv
19058 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 | chip programmers | 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