|
  
- 帖子
- 975
- 精华
- 0
- 积分
- 1950
|
7#
发表于 2002-3-18 09:58
| 只看该作者
Clock
by Chris Pelkie
Vice President/Scientific Visualization Producer
Conceptual Reality Presentations, Inc.
chrisp@tc.cornell.edu
A few weeks ago someone asked about showing seconds on a clock. Here's a motion math solution for a similar problem.
It may be too obscure: pester me and I'll find time to document it more clearly if you can't figure it out. The problem I was solving was to display a clock for a tsunami simulation (not a Psunami simulation, sorry Brian! this was the real thing, well, simulation of a real thing that hit Taiwan) which had simulation time steps on minutes and 10s or 20s intervals but which we laid the frames down on 2's since the researcher didn't have infinite time to simulate and render on 1's. Got that? (At each time: 1:00, 1:10, 1:20, 1:30, 1:40, 1:50, 2:00, ..., we had a frame that I laid on 2s). Anyway, it might point out a couple of oddball math tricks you might not have thought about. I presume it's obvious that you drive two different Numbers objects positioned next to each other (I put a static ":" between them) with the minutes and your choice of the seconds scripts below.
// Generates integer series for minutes clock
// for frames on 2's representing 10s interval pairs, set framesPerSimMin to 12
// then set Sample at to 2.5 samples/sec (30/12)
// for frames on 2's representing 20s interval pairs, set framesPerSimMin to 6
// then set Sample at to 5 samples per sec
framesPerSimMin = 6;
thisMin = floor(frame_num()/framesPerSimMin);
if (thisMin >= 60)
thisMin = thisMin - 60;
value(pop_layer(1), pop_property(1)) [pop_channel(1)] = thisMin;
********* and here ***************
********** Cut here (Seconds on 10s.mm) *********
// Generates integer series for 10 second jump clock
// used for frames on 2's representing 10s interval pairs
// set sample at 15 samples/sec
theFrame = floor(frame_num()/2);
if ( theFrame >= 6 )
theFrame = floor(fmod(theFrame,6));
thisSec = theFrame * 10;
value(pop_layer(1), pop_property(1)) [pop_channel(1)] = thisSec;
********* and here ***************
********** Cut here (Seconds on 20s.mm) *********
// Generates integer series for 20 second jump clock
// used for frames on 2's representing 20s interval pairs
// set sample at 15 samples/sec
theFrame = floor(frame_num()/2);
if ( theFrame >= 3 )
theFrame = floor(fmod(theFrame,3));
thisSec = theFrame * 20;
value(pop_layer(1), pop_property(1)) [pop_channel(1)] = thisSec;
********* and here *************** |
|