Unwanted 'Pulsing' when Changing an Image's Angle
Alejandro Tejada
capellan2000 at gmail.com
Tue Sep 16 20:49:48 EDT 2014
Randy Hengst wrote
> I don't know how to totally get rid of the wobble …
> it seems like there is always a bit one one…
> but I've seen the pulsing effect when
> rotating an image with lockLoc set to true.
Yes, lockLoc produces this effect in
a rotating image. :(
Check if this handler posted by Jim Hurley
could help in your project:
On Jan 08, 2012, jim hurley posted
The script below will allow you to rotate an image about any predefined
point.
Create a button.
Create an image.
Place the button at any point relative to the image. (Perhaps use a grab me
in a mousedown handler.)
Click the button.
The image will rotate about the center of the button.
(For your application you would replace the center of rotation with the
center of mass.)
on mouseUp
set the angle of img 1 to 0
put the loc of me into myLoc
--Set the coor of the rotation Pt
put item 1 of myLoc into x0
put item 2 of myLoc into y0
--Get the loc of the image
put the loc of img 1 into tLoc
put item 1 of tLoc into xC
put item 2 of tLoc into yC
--Get the distance between the roation pt and the image center
put sqrt ( (xC - x0 )^2 + (yC - y0)^2 ) into L
--Get the angle of the line from the rotation center to the image center
put atan2(yC-y0, xC-x0) *180/pi into phi0
put 0 into tAngle
repeat 360 times
lock screen
set the angle of img 1 to -tAngle
put phi0 + tAngle into phi
set the loc of img 1 to (x0 + L * cos(phi*pi/180)), (y0 + L *
sin(phi*pi/180))
unlock screen
add 1 to tAngle
wait 10 millisec --or whatever
end repeat
end mouseUp
on mouseDown
grab me --So that you can relocate the rotation center.
end mouseDown
>From this thread:
http://runtime-revolution.278305.n4.nabble.com/Rotate-around-Center-of-Mass-td4273701.html
--
View this message in context: http://runtime-revolution.278305.n4.nabble.com/Missing-dragData-image-tp4683313p4683321.html
Sent from the Revolution - User mailing list archive at Nabble.com.
More information about the use-livecode
mailing list