Gamestudio Links
Zorro Links
Newest Posts
phantom() not defined in indicators.c
by AndrewAMD. 08/05/26 17:49
Pause button for evaluation shell?
by AndrewAMD. 08/05/26 13:42
Fun Arcade Car Physics (nfs style)
by Ezzett. 08/02/26 21:11
ZorroGPT
by TipmyPip. 07/31/26 22:56
Wolfram Mathematica with Zorro
by TipmyPip. 07/30/26 02:07
What are you working on?
by rayp. 07/24/26 22:58
AUM Magazine
Latest Screens
Dorifto samurai
Shadow 2
Rocker`s Revenge
Stug 3 Stormartillery
Who's Online Now
2 registered members (Quad, AndrewAMD), 1,415 guests, and 3 spiders.
Key: Admin, Global Mod, Mod
Newest Members
riggi89, shuhari, KD1990, Student_64151, Koti
19222 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
camera follows target without moving? #309061
02/06/10 22:19
02/06/10 22:19
Joined: Dec 2009
Posts: 71
N
ncc1701d Offline OP
Junior Member
ncc1701d  Offline OP
Junior Member
N

Joined: Dec 2009
Posts: 71
The tutorial shows a ball game where a camera follows the ball always at a certain distance from the target ball. I get that.
How might I go about following the target ball from a fixed location? Like camera is locked down and target follows the ball?
Looking for hints.
thank you.

Re: camera follows target without moving? [Re: ncc1701d] #309065
02/06/10 22:36
02/06/10 22:36
Joined: Oct 2007
Posts: 5,211
İstanbul, Turkey
Quad Online
Senior Expert
Quad  Online
Senior Expert

Joined: Oct 2007
Posts: 5,211
İstanbul, Turkey
VECTOR temp;
vec_set(temp,ball.x);
vec_sub(temp,camera.x);
vec_to_angle(camera.pan,temp);

if camera looks backwards try this one:

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


3333333333

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