Jump to content
Sign in to follow this  
MerkurAlex

Math question with A2Dv2

Recommended Posts

MerkurAlex

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]

Share this post


Link to post
Share on other sites
Authenticity

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.

Share this post


Link to post
Share on other sites
jvanegmond

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 )

Posted Image

Share this post


Link to post
Share on other sites
MerkurAlex

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 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]

Share this post


Link to post
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×