SA-MP Forums Archive
Problem with object rotation values - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Problem with object rotation values (/showthread.php?tid=523314)



Problem with object rotation values [+REP] - Rimeau - 01.07.2014

Hello there,

unfortunately I haven't found a better map editor than MEd 0.32 in almost a decade of GTA modding, and one problem is really starting to render me completely desperate:

The rotation values shown in MEd never match what has to be in the script to actually create the object ingame with the right rotation - Nothing new so far, the easiest way to fix this was to just subtract the Z-rotation from 360.0.

But now I have an object with rotations around all axis, this is the MEd display on the left and ingame with the MEd values on the right:



I know MTA map editor has a good reputation, but I've never gotten MTA to work...

I tried the SAMP map creator (which is a little buggy too, so...) to just tell me the rotation values but they are all 0.0, even though the object is shown the way it's supposed to be. If I duplicate the object, all rotation values stay 0.0, and if I move it the object changes it orientation to actual 0.0, 0.0, 0.0, so no answer there.
(see picture)



Another idea of solving this problem was to convert the quaternion angles found in the *.ipl file, but I just couldn't get a result out of these either...

Код:
18798, MRoadB45T15DegL, 0, -113.04, 2137.72, 36.64, -0.128409711979, 0.0931437097701, -0.184402492606, -0.969964388996, -1
The last idea I had was to rotate the object ingame and check the values, to see how to calculate them using the MEd values, the ingame values look somewhat like this (might be a few degrees off):

Код:
-16.4, 8.0, -20.3
So if you have another idea or know the logic behind getting the right values, PLEASE tell me!


Re: Problem with object rotation values - Rimeau - 05.07.2014

Anyone, please?


Re: Problem with object rotation values - Virtual1ty - 05.07.2014

Yes, well, don't use MEd for SA:MP related object mappings, it uses GTA system of rotations and yes, you have to convert quat to euler, so I tried, YJIET (a.k.a Stylock) made a function for it, but still the degrees were incorrect...

Use the "SA:MP Map Construction" made by JernejL, and rotation values for the road you mentioned in pics, id 18798, rotated perfectly fine for me and rotation values were there. Try downloading the latest Map Construction and overwrite your old files.

Here's my version, try downloading that.