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
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 | 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