Gamestudio Links
Zorro Links
Newest Posts
ZorroGPT
by TipmyPip. 10/06/26 05:32
Purchase A8 full licence version
by jcl. 10/05/26 12:12
Respect History setting for Z systems
by AndrewAMD. 10/02/26 15:43
AUM Magazine
Latest Screens
Dorifto samurai
Shadow 2
Rocker`s Revenge
Stug 3 Stormartillery
Who's Online Now
1 registered members (JeyKey II), 20,386 guests, and 2 spiders.
Key: Admin, Global Mod, Mod
Newest Members
JimSimons, julienp, julienper, KelleyAbbey, Yopachi
19246 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