Gamestudio Links
Zorro Links
Newest Posts
Pause button for evaluation shell?
by AndrewAMD. 08/13/26 17:16
Sam Foster Sound | Experienced Game Composer for Hire
by titanicpiano14. 08/10/26 12:46
phantom() not defined in indicators.c
by jcl. 08/07/26 11:45
Accepting new programming clients
by AndrewAMD. 08/06/26 21:25
Fun Arcade Car Physics (nfs style)
by Ezzett. 08/02/26 21:11
ZorroGPT
by TipmyPip. 07/31/26 22:56
AUM Magazine
Latest Screens
Dorifto samurai
Shadow 2
Rocker`s Revenge
Stug 3 Stormartillery
Who's Online Now
0 registered members (), 2,144 guests, and 5 spiders.
Key: Admin, Global Mod, Mod
Newest Members
LapHoan, ZeonLau, Ponti233, riggi89, shuhari
19230 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 | 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