alternative to displayWorld
jpierce at cs.cmu.edu
Tue Sep 7 19:31:45 UTC 1999
At 10:43 PM 9/7/99, Luciano Notarfrancesco wrote:
>I'm trying to sinchronize sound with animations implemented in morphic.
>Right now I doing some experiments with simple 2D animations, but I really
>want to use Alice soon. How often is a Wonderland view redrawn? Can it be
>done at very short time intervals?
The short answer is: as often as possible. ;)
A longer answer is that every time the Morphic world containing the
Wonderland steps, the Wonderland tells all it's cameras to redraw their
views. How often this actually happens depends on how many cameras you
have active (Wonderland trivia bit for the day: you can make multiple
cameras, and hence multiple views, in a Wonderland by evaluating "w
makeCamera"), how many polygons you've got in the scene, how big the render
windows are, etc. With a fairly simple scene containing a single camera on
a Pentium II 300 I get around 15 fps (or a redraw every 66 ms).
BUT unlike Morphic, animations in Alice are _time_ based, not _frame_
based. Because Morphic is frame based, if you run a Morphic animation on
computer that's twice as fast the animation will run twice as fast. If you
run an Alice animation on a faster computer the animation will take the
same amount of time, but it will look smoother (because you're getting more
frames per second and therefore drawing more intermediate states). So (in
theory) if you're trying to synchronize Alice animations with sound you
just figure out at what times you want things to happen and write your
animations without worrying about how often the Wonderland is rendered.
More information about the Squeak-dev