Smooth hand Rotation through an arc

Here’s my latest creation.

I think it looks pretty nice. Now to be honest, I’m no artist. I could not create the original image I used to create the basic face. I found it on-line with faded numbers and smudges, but that image served me well as a template. It also piqued my interest because the challenge was to make the hands move correctly and smoothly without using the usual tags since the hands do not complete a 360º arc.
I thought this was worth posting because even though the techniques for moving hands through an arc have been discussed on this forum, I could not find advice to make the hour, minute, and second hand move through their arc smoothly rather than jumping from number to number and staying there until it was time to change, so I present my solution:
I started in the usual way finding the starting position and ending position of the hand, just rotating it in Facer Creator until I had it in the right place. With those numbers I calculated the size of the arc. So for example, my hour hand pointed to 0 at - 58º and pointed to 12 at 59º giving me an arc of 117. Since there are 12 increments, the increment (#Dh#) has to be multiplied by 9.75 (117/12), giving me a rotation formula of (-58+(9.75*(#Dh#))). But that will make the hand jump from 1 to 12 without moving smoothly through the hours. The increments between the hours are minutes and there are 60 of them per hour, so if I add the minutes divided by 60 to the hour and multiply that total by 9.75, the hour hand movement will reflect the minutes and move more smoothly. The resulting formula was (-58+(9.75*(#Dh#+(#Dm#/60)))).
But that creates a new problem. Once the hour hand move to 12, you don’t want it moving past 12 as the minutes increase. You’d like it to move between 0 and 1. For that I made a new hand to move from 0 to 1 using the formula (-58+(9.75*((#Dm#/60)))) where only the minutes affected the hour hand movement. To use both hands, we need an opacity of 100 when the hand is supposed to show and 0 when not, so for the hand that moved from 1 to 12 the opacity formula was (100*(((#Dh#+#Dm#/600)<=12))). I know most people use conditionals, but I get less confused when I use simple math. If the math in this equation is less than or equal to 12 it returns “true” resulting in multiplying by 1. As soon as the hour passes 12 #Dh# plus a small increment of the seconds (#Dm#/600) will result in a valua greater than 12 making the equation false and multiplying the opacity by 0. For the hand that moves only from 0 to 1 (representing after 12 o’clock) the opacity equation was (100*(((#Dh#+#Dm#/600)>12))). As soon as #Dh# (the time) switches from 12 to 1 the equation is no longer > 12 and so is false resulting in an opacity of 0.
Minute hand rotation tends to look smooth without tinkering since the increments are smaller, but I chose to smooth it more using the same logic resulting in this equation for the rotation: (-58+(1.95*(#Dm#+(#Ds#/60)))). In this case the arc of 117 was divided by 60 minutes/hour to get the mutiplier of 1.95.
The second hand was easiest of all since there is a tags for seconds that includes milliseconds, resulting in a rotational formula of (-58+(1.95*#Dsm#)).
You’ll note that, because of the shape of the face, all the hands started at -58º and ended at 59º resulting in the same arc of 117 for all the hands. At least that made things a little easier.
-Warren

4 Likes

Main thing is, you made it work as needed. Maybe the formulas could be a bit simpler using the original smooth rotation tags like this:
(#DWFKS#*117/360-58) for hours
(#DWFMS#*117/360-58) for minutes
117/360 defines the part of circle the hand has to rotate within, the 58 is the starting angle.

3 Likes

That would have been handy to know, but I couldn’t find that information anywhere. I will say the challenge was fun, even though I was sure there had to be a more elegant way to do it.

3 Likes

Thanks for the education, that looks pretty neat, very well done :smiley:

1 Like

Nice job @wsilbers! Finding the solution to challenging things such as your hand movements is the rewarding part of this hobby. Need not be elegant, as long as it works. :+1:

1 Like

Just as important, folks looking for information on smooth hand rotation will find petruuccios more elegant solution in this thread. If I could find that info when I started my project, I would have used it