  | | | Math Wizards... | Math Wizards... 2004-03-09 - By Emile Swain
Back onPress
You need to store the click point.
Work out the angle of this click point from the center of the wheel
You also need to store the angle of the obj(ipod wheel) i.e.
initclickangle = obj._rotation.
On enterframe
Work out the current click point
Work out the angle given by the current click point
Subtract the initial click point angle.
Ever tween the angle between the current and last angle to create a
smooth motion
Or directly assign subtracted angle += rotation of wheel
Tan(theta) = o/a
Sin(theta) = o/h
Cos(theta) = a/h
Where h = hypontaneuse
A = adjacent
O = opposite
So clickang = Math.atan(o/a)
Currentang = Math.atan(mousex/mousey)
Obj._rotation = obj.initclickangle + ( currentang - clickang)
Ok, it wont work %100 but it 's a rough idea.
-----Original Message-----
From: Doug Coning [mailto:DougC@(protected)]
Sent: 09 March 2004 18:15
To: flashcoders@(protected)
Subject: [Flashcoders] Math Wizards...
Allright Math Wizards,
I don 't know if anyone wants to give this a shot, but I 'm creating an
inhouse flash demo project to show my boss some of Flash 's capabilities.
I am modelling the flash file off an Apple iPod. It will load an XML
menu of songs, and then load them dynamically. The user can select a
song and play it. Of course in the middle of the iPod is the wheel that
allows you to increase or decrease the volume based upon which way you
go around the wheel.
I 've created a wheel button and have a listener that returns the x & y
coordinates of the mouse as it moves around the wheel.
However, this is where I get stuck. Based on the x & y coordinates (and
previous mouse move coordinates), how do I determine if the mouse is
rotating clockwise or counter-clockwise around the wheel?
If anyone has any suggestions, I 'd greatly appreciate your help.
Blessings,
Doug Coning
Software Developer
FORUM Solutions, LLC
=----------------------------------------------------------------------
Supported by Fig Leaf Software
=----------------------------------------------------------------------
Be sure to check the archives and the wiki:
http://chattyfig.figleaf.com/
=----------------------------------------------------------------------
http://chattyfig.figleaf.com/cgi-bin/ezmlm-cgi?1:mss:106476
=----------------------------------------------------------------------
To unsubscribe send a blank e-mail to:
Normal Mode: flashcoders-unsubscribe@(protected)
Digest Mode: flashcoders-digest-unsubscrive@(protected)
=----------------------------------------------------------------------
Supported by Fig Leaf Software
=----------------------------------------------------------------------
Be sure to check the archives and the wiki:
http://chattyfig.figleaf.com/
=----------------------------------------------------------------------
http://chattyfig.figleaf.com/cgi-bin/ezmlm-cgi?1:mss:106478
=----------------------------------------------------------------------
To unsubscribe send a blank e-mail to:
Normal Mode: flashcoders-unsubscribe@(protected)
Digest Mode: flashcoders-digest-unsubscrive@(protected)
|
|
 |