expressions watch animation

Become a member of the CGSociety

Connect, Share, and Learn with our Large Growing CG Art Community. It's Free!

Thread Tools Search this Thread Display Modes
  01 January 2011
expressions watch animation

Hello, i am creating a clock animation for a watch that i am modelling that is created and modeled by python code and expressions, i have done it all and got the hour hand to be correct but i cant figure out what figures i should be putting for the minOffset and the secOffset. Any help would be greatly appreciated. Thanks

  # Hour hand
   cmds.expression( o='hourHand[0]', s="hourHand.rotateZ=-frame/3000+%d"%hourOffset)
  # minute hand
 cmds.expression( o='minHand[0]', s="minHand.rotateZ=-frame/250+%d"%minOffset)
  # second hand
   cmds.expression( o='secHand[0]', s="secHand.rotateZ=-6*frame/25+%d"%secOffset)
  # applying the expressions
 cmds.expression( o='secHand[0]', s='secHand.rotateZ=-6*frame/25' )
   cmds.expression( o='minHand[0]', s='minHand.rotateZ=-1*frame/250' )
   cmds.expression( o='hourHand[0]', s='hourHand.rotateZ=-30*frame/3000' )
  01 January 2011
You need the angles for the three clock hands.
Initialize the three clock hands to 12, and the angle of each one to zero.

Now for s seconds you need the rotation angle:

sec_angle = s/60*2*pi

For m minutes and s seconds:

min_angle = (m/60 + s/60/60)*2*pi

For h hours m minutes and s seconds:

hour_angle = (h/12 + m/60/12 + s/60/60/12)*2*pi
  01 January 2011
Thread automatically closed

This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.
CGTalk Policy/Legalities
Note that as CGTalk Members, you agree to the terms and conditions of using this website.
Thread Closed share thread

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Society of Digital Artists

Powered by vBulletin
Copyright 2000 - 2006,
Jelsoft Enterprises Ltd.
Minimize Ads
Forum Jump

All times are GMT. The time now is 07:17 AM.

Powered by vBulletin
Copyright ©2000 - 2018, Jelsoft Enterprises Ltd.