Rotate Graphic Image Smoothly?

Jim Ault JimAultWins at yahoo.com
Fri Feb 2 14:04:49 EST 2007


On 2/2/07 8:28 AM, "harrison at all-auctions.com" <harrison at all-auctions.com>
wrote:
> The image is not transparent so that is not the issue.
> I want a smooth rotation not a choppy one that I seem
> to be getting.  Yes I was using the set angle of the image,
> but as I said it seems choppy to me.  Is there a better way
> or am I stuck?

--untested, just ideas to get you closer
Make two images, one slightly (1/2 a degree) rotated from the first.
step the rotation of each by 1 degree, hiding and showing each thus

show grc verB  --always, one layer behind
--unless the rectangle is visible, etc.
--added optional lines for using blendlevel transitions
put 1 into cnt
repeat for 360 times
  show grc verA
  --set the blendlevel of grc verB to 0
  --wait 20 milliseconds
  --set the blendlevel of verA to 60

  set the rotation of grc verB to 0+ cnt
  hide grc verA
  set the rotation of grc verA to 0+ cnt
   --set the blendlevel of grc verA to 0
  --wait 20 milliseconds
  --set the blendlevel of grc verB to 60
  add 1 to cnt
end repeat

Not the best solution
Depending on the details of your app, you might consider a subStack with the
windowshape set to a circle, which would clip the rectangle corners, or use
maskData|alphaData to clip the rectangle corners

Hope this helps

Jim Ault
Las Vegas





More information about the use-livecode mailing list