I'm guessing the rotation in Shape2D is using sin()/cos() which are
continuous functions, but it's quantizing the position integrally
(because individual pixels have integer coordinates) during the
rendering process. You'd need a method to not only do the rotation
smoothly (either with sin/cos, or linear algebra; i.e. matrix
multiplication), but to anti-alias the result during rendering.
You could also simulate a control (dial) with a detent (a sort of
mechanical analog to 'snap-to-grid', only - in this case - it would be
more like 'snap-to-angle') Then you could cut down on the number of
images necessary to render. For example, try 'rotating' your 'knob'
only through even angle displacements (2 degrees, or pi/90 radians.)
That might help cut down on the number of perceived 'corners'. Of
course, this'll also decrease your knob's resolution, too...
On Mar 16, 2006, at 2:46 PM, E. Tejkowski wrote:
On Mar 16, 2006, at 10:28 AM, Dave Addey wrote:
I've done this via method b), and it's really not that much of a pain.
One session of sitting down with the rotate tool in Photoshop and
automating the
export process, and you're done. I found that 72 graphics made for a
smooth
rotate - one for every 5 degrees. My class stores the actual angle
even
more accurately, and just uses the closest angle graphic when
rendering.
Nice work on the interface. I've have also done something like this
with similarly pleasant results. However, I disagree that it's not a
pain to render all those images. For me it was a huge nuisance. Add to
that Joe's idea of doing it in 3D (which I also did) and you are
looking at a major time commitment for just one knob. Then, if you
want to tweak something in the graphic, it's back to the drawing board
and re-rendering it all... nevermind that you often need multiple
designs in one interface. Ugh.
I think what I'm really looking for is a combination of ideas here.
I'd like to render one image as the background and like Joe said, the
knob shadows will remain realistic, since shadows don't change as you
rotate. Then, I'd like a small indicator like Phil mentioned that does
the actual rotation. Trouble is, anytime I've tried to use the
rotation in Shape2D, it never comes out feeling smooth. It always
feels a little bit off, almost like it has "corners" in the travel.
Maybe I just have bad math in my code.
Revised question: does anyone have a demo of a 2D Shape being rotated
smoothly?
_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>
Search the archives of this list here:
<http://support.realsoftware.com/listarchives/lists.html>
William H Squires Jr
4400 Horizon Hill #4006
San Antonio, TX 78229
[EMAIL PROTECTED] <- remove the .nospam
_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>
Search the archives of this list here:
<http://support.realsoftware.com/listarchives/lists.html>