Gamestudio Links
Zorro Links
Newest Posts
loading historical data 1st time
by AndrewAMD. 04/14/23 12:54
Trade at bar open
by juanex. 04/13/23 19:43
Bug in Highpass2 filter
by rki. 04/13/23 09:54
Adding Limit Orders For IB
by scatters. 04/11/23 16:16
FisherN
by rki. 04/11/23 08:38
AUM Magazine
Latest Screens
SHADOW (2014)
DEAD TASTE
Tactics of World War I
Hecknex World
Who's Online Now
3 registered members (AndrewAMD, The_Judge, Grant), 898 guests, and 5 spiders.
Key: Admin, Global Mod, Mod
Newest Members
rki, FranzIII, indonesiae, The_Judge, storrealba
18919 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
plataform #310797
02/17/10 01:14
02/17/10 01:14
Joined: Dec 2008
Posts: 83
Buenos Aires, Argentina
F
Funeral Offline OP
Junior Member
Funeral  Offline OP
Junior Member
F

Joined: Dec 2008
Posts: 83
Buenos Aires, Argentina
in a plataform game, when i rotate the camera it moves and i cant see the player anymore, so i wanna know if there's a simple code to keep the player in the center of the scene all the time and the camera rotates around him.

Re: plataform [Re: Funeral] #310800
02/17/10 01:24
02/17/10 01:24
Joined: Sep 2003
Posts: 6,861
Kiel (Germany)
Superku Offline
Senior Expert
Superku  Offline
Senior Expert

Joined: Sep 2003
Posts: 6,861
Kiel (Germany)
I'm not quite sure if I understand what you're trying to do, but nevertheless:

function center_camera_startup() {
var distance, angle;
VECTOR temp;
distance = 500;
angle = 0;
while(1) {
if(player) {
camera.x = player.x-distance*cos(angle);
camera.y = player.y-distance*sin(angle);
camera.z = player.z+64;

vec_set(temp,player.x);
vec_sub(temp,camera.x);
vec_to_angle(camera.pan,temp);

angle += (key_1-key_2)*10*time_step;
angle %= 360;
}
wait(1);
}
}


"Falls das Resultat nicht einfach nur dermassen gut aussieht, sollten Sie nochmal von vorn anfangen..." - Manual

Check out my new game: Pogostuck: Rage With Your Friends

Moderated by  HeelX, Lukas, rayp, Rei_Ayanami, Superku, Tobias, TWO, VeT 

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