.:HyPeX:. Posted September 24, 2014 Share 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. Link to comment
LonelyRoad Posted September 25, 2014 Share Posted September 25, 2014 Can you clarify your question? Tell us what you're trying to do or give an example... Link to comment
Moderators IIYAMA Posted September 25, 2014 Moderators Share 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 Link to comment
.:HyPeX:. Posted September 26, 2014 Author Share 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 Link to comment
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