Gamestudio Links
Zorro Links
Newest Posts
AlpacaZorroPlugin v1.3.0 Released
by kzhao. 05/22/24 13:41
Free Live Data for Zorro with Paper Trading?
by AbrahamR. 05/18/24 13:28
Change chart colours
by 7th_zorro. 05/11/24 09:25
Data from CSV not parsed correctly
by dr_panther. 05/06/24 18:50
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
0 registered members (), 984 guests, and 5 spiders.
Key: Admin, Global Mod, Mod
Newest Members
LucasJoshua, Baklazhan, Hanky27, firatv, wandaluciaia
19053 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