Rotating objects according to IPL rotation

Started by Murdock, Jul 13, 2015, 08:43 AM

Previous topic - Next topic

Murdock

I made a map using the mED map editor, which generates an IPL file that looks as following:
672, dk_waretank, 0, -1120.85799496, -1419.7517738, 13.6682, 1, 1, 1, 0, 0, 0.190808836192, 0.98162721439
Now I want to spawn this object in VC:MP, not by using an xml file but by using the CreateObject function.
However, the following approach does not seem to set the right rotation as it appears in the map editing software:
dk_waretank <- CreateObject( 672, 0, Vector(-1120.85799496, -1419.7517738, 13.6682), 255 );
dk_waretank.RotateTo( Quaternion(0, 0, 0.190808836192, 0.98162721439), 0 );

I have tried using both IPL2Code converters made by YSC and Thijn without any luck.
How can I get VC:MP to apply the right rotation to my objects?

EK.IceFlake

Try this
dk_waretank.RotateToEuler( Vector(0, 0.190808836192, 0.98162721439), 0

Murdock

Quote from: NE.CrystalBlue on Jul 13, 2015, 08:54 AMTry this
dk_waretank.RotateToEuler( Vector(0, 0.190808836192, 0.98162721439), 0 )

Unfortunately didn't work, it made the object point at the sky

MacTavish

hey @Murdock have you tried moo mapper that works fine for me

Grand Hunting Project
Join #SLC, #KAKAN, #Doom, #GHP @LUnet

Retired VC:MP Player/Scripter :P

Murdock

Quote from: Beztone on Jul 13, 2015, 09:54 AMhey @Murdock have you tried moo mapper that works fine for me

I just tried Moo Mapper as you said and created a bridge, double clicking the object shows me these properties:



Now according to these properties I've tried various ways to rotate the object including:
dk_shipstair.RotateTo( Quaternion( 0.0, 0.0, -0.608761, 0.793353 ), 0 );
dk_shipstair.RotateTo( Quaternion( 0.0, 0.0, -37.50, 37.50 ), 0 );
dk_shipstair.RotateToEuler( Vector( 0.0, 0.0, -37.50 ), 0 );
dk_shipstair.RotateToEuler( Vector( 0.0, 0.0, 37.50 ), 0 );

But none of these seem to apply the correct rotation. Any ideas?

Gudio

CreateObject( 672, 0, Vector( -1120.858, -1419.752, 13.668 ), 255 ).RotateTo( Quaternion( 0, 0, 0.191, -0.982 ), 0 );?? I'm on mobile atm but try this.

Stormeus


Murdock

Quote from: Stormeus on Jul 13, 2015, 01:11 PMTry using @ysc3839 's tool and see what happens.
https://ysc3839.github.io/vcmpconv/ipl2code.html
Didn't work, same result as Thijn's converter.

Quote from: Gudio on Jul 13, 2015, 01:02 PMCreateObject( 672, 0, Vector( -1120.858, -1419.752, 13.668 ), 255 ).RotateTo( Quaternion( 0, 0, 0.191, -0.982 ), 0 );?? I'm on mobile atm but try this.

That seemed to work, but may I ask how you got those values and how can I apply it to the other objects?

aXXo

Try
dk_shipstair.RotateTo( Quaternion( 0.0, 0.0, 0.608761, 0.793353 ), 0 );

Reference: http://forum.vc-mp.org/?topic=148.msg1082#msg1082

ysc3839


Sebastian

#10
Solution: Convert quaternion to euler.
This means you will use
object.RotateToEuler( Vector( x, y, z), time )
instead of
object.RotateTo( Quaternion( x, y, z, w ), time ).

PS: Don't have any function for this, but I know for sure that it will work. (can't really say how I know that xD)