Calculate RZ from X and Y
#7

Quote:
Originally Posted by m4karow
Посмотреть сообщение
Thanks for the reply dude
Anyway i don't really understand what you sayin' with my sh!t english But i tried both example that you said

Код:
a = atan2(vy, vx) - 90.0
and

Код:
DumpsterData[dumpsterid][dumpsterR] = (-atan2(X, Y) + 45.0);
and the result is almost that i want.


but if the rotation of the object has not equals to 0.0;


soo could you give me more advice to finish this? i want to 'clone' all of theese dumpsters with server sided objects.
i'm very bad in maths so im look like this now
You cannot just use the coordinates. That gives an angle relative to the SA Map Center - 0.0, 0.0 (which is completely wrong).

You need 2 points from which you can calculate an angle (in the direction from Point A to Point B), but this condition isn't met as each Dumpster just has one set of coordinates without any info about its direction.

There is no way to tell in which direction it should be facing just from its coords. In this case you'll have to rotate them manually.
Reply


Messages In This Thread
Calculate RZ from X and Y - by m4karow - 11.04.2018, 20:11
Re: Calculate RZ from X and Y - by Mugala - 11.04.2018, 21:27
Re: Calculate RZ from X and Y - by NaS - 12.04.2018, 14:28
Re: Calculate RZ from X and Y - by Joe Staff - 12.04.2018, 14:35
Re: Calculate RZ from X and Y - by NaS - 12.04.2018, 14:50
Re: Calculate RZ from X and Y - by m4karow - 12.04.2018, 15:26
Re: Calculate RZ from X and Y - by NaS - 12.04.2018, 15:57
Re: Calculate RZ from X and Y - by Pottus - 12.04.2018, 17:07
Re: Calculate RZ from X and Y - by m4karow - 12.04.2018, 17:19
Re: Calculate RZ from X and Y - by Pottus - 12.04.2018, 17:24

Forum Jump:


Users browsing this thread: 3 Guest(s)