Gamestudio Links
Zorro Links
Newest Posts
Zorro 2.70
by jcl. 09/29/25 09:24
optimize global parameters SOLVED
by dBc. 09/27/25 17:07
ZorroGPT
by TipmyPip. 09/27/25 10:05
assetHistory one candle shift
by jcl. 09/21/25 11:36
Plugins update
by Grant. 09/17/25 16:28
AUM Magazine
Latest Screens
Rocker`s Revenge
Stug 3 Stormartillery
Iljuschin 2
Galactic Strike X
Who's Online Now
1 registered members (TipmyPip), 18,449 guests, and 6 spiders.
Key: Admin, Global Mod, Mod
Newest Members
krishna, DrissB, James168, Ed_Love, xtns
19168 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