Gamestudio Links
Zorro Links
Newest Posts
separating groups of 3 digits by a comma
by joe_kane. 01/11/26 00:01
MRC.c and WFO
by joe_kane. 01/10/26 23:58
BarOffset (default = 940 for daily bars?
by joe_kane. 01/10/26 23:46
NOMAX undeclared identifier.
by Petra. 01/09/26 21:12
Sam Foster Sound | Experienced Game Composer for Hire
by titanicpiano14. 01/07/26 15:14
Zorro locks DLL
by jcl. 01/07/26 13:33
AUM Magazine
Latest Screens
Rocker`s Revenge
Stug 3 Stormartillery
Iljuschin 2
Galactic Strike X
Who's Online Now
1 registered members (joe_kane), 5,490 guests, and 19 spiders.
Key: Admin, Global Mod, Mod
Newest Members
joe_kane, Namitha_NN, Syndrela, agasior, mosfet
19189 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
camera smooth turn prolem #373009
06/06/11 18:06
06/06/11 18:06
Joined: Dec 2010
Posts: 87
R
romin2011 Offline OP
Junior Member
romin2011  Offline OP
Junior Member
R

Joined: Dec 2010
Posts: 87
Hello!
This code smoothly turns an entity toward target entity, but if i use it to turn the camera smoothly toward the target entity(turn the camera independent of any player etc) the camera keeps turning doesn't stop reaching the target angle?

Code:
VECTOR a,b;
vec_diff(a,cover.x,my.x);
vec_to_angle(b,a);
camera.pan+=ang(b.x-my.pan)*0.3*time_step;



Re: camera smooth turn prolem [Re: romin2011] #373057
06/07/11 08:31
06/07/11 08:31
Joined: Dec 2010
Posts: 87
R
romin2011 Offline OP
Junior Member
romin2011  Offline OP
Junior Member
R

Joined: Dec 2010
Posts: 87
Someone please?

Re: camera smooth turn prolem [Re: romin2011] #373068
06/07/11 10:33
06/07/11 10:33
Joined: Sep 2003
Posts: 6,861
Kiel (Germany)
Superku Offline
Senior Expert
Superku  Offline
Senior Expert

Joined: Sep 2003
Posts: 6,861
Kiel (Germany)
Quote:
the camera keeps turning doesn't stop reaching the target angle?

Describe your problem more precisely in different words.


"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
Re: camera smooth turn prolem [Re: Superku] #373074
06/07/11 11:12
06/07/11 11:12
Joined: Dec 2010
Posts: 87
R
romin2011 Offline OP
Junior Member
romin2011  Offline OP
Junior Member
R

Joined: Dec 2010
Posts: 87
The player runs toward cover once reached he turns oposite the wall. The camera should now smoothly turn to face player(not behind him, it is wall behind him).
I hope i could describe the situation.

Re: camera smooth turn prolem [Re: romin2011] #373088
06/07/11 13:20
06/07/11 13:20

M
mercuryus
Unregistered
mercuryus
Unregistered
M



camera.pan+=(ang(b.x)-ang(my.pan))*0.3*time_step; // maybe - can remember i once had such a problem...

Re: camera smooth turn prolem [Re: ] #373100
06/07/11 14:28
06/07/11 14:28
Joined: Dec 2010
Posts: 87
R
romin2011 Offline OP
Junior Member
romin2011  Offline OP
Junior Member
R

Joined: Dec 2010
Posts: 87
@mercuryus it still keeps rotating and doesn't stop frown

Re: camera smooth turn prolem [Re: romin2011] #373108
06/07/11 15:56
06/07/11 15:56

M
mercuryus
Unregistered
mercuryus
Unregistered
M



found this... maybe it helps

Code:
// turn an object to an destination
function turnto(ENTITY* pe, var* ppos, var* p_speed){
var lva[3];
	
	vec_set(temp, ppos[0]);	
	vec_sub(temp, pe.x);
	vec_to_angle(lva[0], temp);
	c_rotate(pe, vector(ang((lva[0])-(pe.pan))*p_speed[0]*time_step, ang((lva[1])-(pe.tilt))*p_speed[1]*time_step, ang((lva[2])-(pe.roll))*p_speed[2]*time_step), IGNORE_ME|IGNORE_PASSABLE);

}




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