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, Grant, Neb), 908 guests, and 6 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
rotate an entity in relation of another #383393
09/19/11 21:54
09/19/11 21:54
Joined: Jul 2009
Posts: 85
A
Altarius Offline OP
Junior Member
Altarius  Offline OP
Junior Member
A

Joined: Jul 2009
Posts: 85
Hi,

i have write a code who rotate a cube "cube2" in relation of another cube "cube1"...

action rotate_cube()
{
while(1)
{
cube1.pan += 20 * (key_a - key_d) * time_step;
cube2.pan = cube1.pan + temp ;

if(cube1.pan > temp + 45)
{
temp += 45;
}

if(cube1.pan < temp - 45)
{
temp -= 45;
}

wait(1);
}
}

so if i rotate the cube1 to 45 degree or more, the cube2 are rotated to 45 degree...ect

But there my question.. how to make the second cube to rotate smoothly to the desired angle?

thx

Re: rotate an entity in relation of another [Re: Altarius] #383447
09/20/11 16:15
09/20/11 16:15
Joined: Sep 2003
Posts: 5,900
Bielefeld, Germany
Pappenheimer Offline
Senior Expert
Pappenheimer  Offline
Senior Expert

Joined: Sep 2003
Posts: 5,900
Bielefeld, Germany
vec_lerp(cube2.pan, cube2.pan, cube1.pan + temp, 0.5);


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