MerkurAlex Posted January 29, 2009 Share Posted January 29, 2009 I am absolutely horrible at math(having a headache is not helping) so i have come here for a simple question. I am using a2d to draw an image and based on the x and y of that image and the x and y of the mouse i need to rotate the image 1-360 degrees to point at the mouse. [quote name='PsaltyDS' post='635433' date='Jan 27 2009, 07:04 AM']Larry is a mass murderer?! It's always the quiet, clean cut, bald guys... [/quote] Link to comment Share on other sites More sharing options...
Authenticity Posted January 29, 2009 Share Posted January 29, 2009 I thought I might find sort of _GDIPlus_SetMapMode function but I don't see one heh. Anyway, I don't have a good start point for you on how to implement it in AutoIt nor do I good at math either, but the Gdi.dll got some nice functions like CombineTransform() or SetWorldTransform(). Search msdn about these functions. Rotating HDC usually is implemented in one of some ways using the XFORM struct, just take the mouse coords and calculate the radians between the one of the axises and the mouse point using cos/sin, you might find better explanation than I give in MSDN and Wikipedia. Link to comment Share on other sites More sharing options...
jvanegmond Posted January 29, 2009 Share Posted January 29, 2009 If there's no inbuilt way to rotate the image, then you have to do it yourself. So, because of the lack of information in your post I am just going to make this vague and unclear.Every point on a circle can be defined as: ( cos(x) * radius, sin(y) * radius ) github.com/jvanegmond Link to comment Share on other sites More sharing options...
MerkurAlex Posted January 29, 2009 Author Share Posted January 29, 2009 (edited) The A2D udf has its own function to rotate my problem is finding out how to aim it at the mouse. But i think i got it just let me test a few things. Edited January 29, 2009 by MerkurAlex [quote name='PsaltyDS' post='635433' date='Jan 27 2009, 07:04 AM']Larry is a mass murderer?! It's always the quiet, clean cut, bald guys... [/quote] Link to comment Share on other sites More sharing options...
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