Post: Rotating Model Functions
04-17-2012, 12:23 AM #1
Correy
I'm the Original
(adsbygoogle = window.adsbygoogle || []).push({}); not many people actually know about this, but i thought i would share them.
i haven't posted nothing in this section for a while, so i hope a lot of people find this useful

there's 3 different types of rotation functions
- Clock Wise
- Flipping
- Rolling




obviously you will need to define your model, precache also if needed.
these functions all take the same arguments, but of course do different things

- Arguments taking
    
(rotating degrees, float rotation time, float acceleration time, float deceleration time);


Clockwise:
    
<Your model>[I] [b]RotateYAW[/b][/I](rotating degrees, float rotation time, float acceleration time, float deceleration time);


Flipping:
    
<Your model>[I] [b]RotatePitch[/b][/I](rotating degrees, float rotation time, float acceleration time, float deceleration time);


Rolling:
    
<Your model>[I] [b]RotateRoll[/b][/I](rotating degrees, float rotation time, float acceleration time, float deceleration time);





here's a little example of spawning your own weapon which rotates.
    
Rotate()
{
Model = spawn( "script_model", self.origin + ( 0, 0, 50 ));
Model setModel( GetWeaponModel( self GetCurrentWeapon() ));
self iPrintln( "Spawned Model" );
for(;Winky Winky
{
//Model RotatePitch( 360, 3, 0, 0 );
//Model RotateRoll( 360, 3, 0, 0 );
Model RotateYAW( 360, 3, 0, 0 );
wait 3;
}
}
(adsbygoogle = window.adsbygoogle || []).push({});

The following user thanked Correy for this useful post:

04-18-2012, 02:41 PM #11
Originally posted by 247Yamato View Post
RotateTo is the best, Smile

It depends what you are using it for... I use them all for different things..
04-18-2012, 03:10 PM #12
247Yamato
< ^ > < ^ >
Originally posted by x. View Post
It depends what you are using it for... I use them all for different things..


RotateTo rotates in this 3 ways, you can set it to rotate like any of these:

    model rotateto( ( 60, 0, 0 ), 1 );
model rotateto( ( 0, 30, 0 ), 1 );
model rotateto( ( 0, 0, 120 ), 1 );

The following user thanked 247Yamato for this useful post:

x_DaftVader_x
04-18-2012, 03:25 PM #13
Originally posted by 247Yamato View Post
RotateTo rotates in this 3 ways, you can set it to rotate like any of these:

    model rotateto( ( 60, 0, 0 ), 1 );
model rotateto( ( 0, 30, 0 ), 1 );
model rotateto( ( 0, 0, 120 ), 1 );


I'm lazy, rotatePitch or RotateYaw etc is easier to remember and does the same job Happy

I only use rotateTo if I want to turn to a specific object or point..

target=VectorToAngles(Player.origin - self.origin);
turret rotateTo(target, 1);

Well, something like that anyway Happy
04-19-2012, 12:45 AM #14
xKtF
In my man cave
Originally posted by x. View Post
I'm lazy, rotatePitch or RotateYaw etc is easier to remember and does the same job Happy

I only use rotateTo if I want to turn to a specific object or point..

target=VectorToAngles(Player.origin - self.origin);
turret rotateTo(target, 1);

Well, something like that anyway Happy


when is v7 being released?
04-19-2012, 06:17 AM #15
Originally posted by infinitycl View Post
when is v7 being released?
When it's finished :derp:

The following user thanked x_DaftVader_x for this useful post:

247Yamato
04-19-2012, 04:33 PM #16
Harry
Former Staff
This is quite cool correy ( i spelt it right :fyea: ) i will have to use this Awesome face

Copyright © 2026, NextGenUpdate.
All Rights Reserved.

Gray NextGenUpdate Logo