.:HyPeX:. Posted September 24, 2014 Posted September 24, 2014 Hello, i got a quick question, if i want to go from a point to the north, whats the sum/rest of X,Y that im getting? eg: going to the north by 1 point would represent an increase of X of 1 point. (0.5 if X/Y were made on 45° angles) PD: I'm trying to get a rotation by X,Y Points as in my script the getElementRotation seems to not work.
LonelyRoad Posted September 25, 2014 Posted September 25, 2014 Can you clarify your question? Tell us what you're trying to do or give an example...
Moderators IIYAMA Posted September 25, 2014 Moderators Posted September 25, 2014 function findRotation(x1,y1,x2,y2) local t = -math.deg(math.atan2(x2-x1,y2-y1)) if t < 0 then t = t + 360 end; return t; end rot = findRotation(x,y, x + 0.5 ,y ) https://wiki.multitheftauto.com/wiki/FindRotation
.:HyPeX:. Posted September 26, 2014 Author Posted September 26, 2014 function findRotation(x1,y1,x2,y2) local t = -math.deg(math.atan2(x2-x1,y2-y1)) if t < 0 then t = t + 360 end; return t; end rot = findRotation(x,y, x + 0.5 ,y ) https://wiki.multitheftauto.com/wiki/FindRotation Yeah, got it, thanks thought
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now