Last Modified: 11/07/99 |
||||
|
||||
Animation and Sound
Animation ConceptsAnimation in VRML is implemented in terms of:
Animation Example: a Flashing LightThis simple animation shines a bright yellow light on a purple ball whenever the mouse moves over it. You construct it as follows:
Note the hand drawn red arrows that point to various key elements of the display.
Click here to see the actual animation. It is important to note that you must explicitely name all nodes that are to be linked in the route statement because nodes with default names simply don't show up. Also, the ROUTE statement must appear physically below any nodes that it refers to. Another Example: Motion and ChangeThis animation shows how you can trigger motion and transformations, such as size and rotation. It shows a cone that moves and changes when you move the mouse over it. You create it as follows:
Create a cone object and apply a fire texture to it. At this point
it should look like this:
Next, you click on the Key Frame Animation icon near the
top and then double click on the cone. This opens up a menu at the
bottom which is associated with the cone that contains three timelines
and some controls. The first timeline controls the position, whereas the
other two control rotation and scale (you can add other timelines that
control color, transparency, etc.). You create the animation by
using the mouse to click somewhere in the timeline and then carry out the
action. For example, to move the object at time 0.2, you click on the
first timeline at 0.2, then use the mouse to move the cone to its new
position (you can also type in positions if you need exact values).
You can script scale and rotation values in the same way.
We can test this animation using the motion controls near the bottom.
The arrows control forward and backward animation and the arrow in the
form of a loop makes the action continuous.
At this point
the screen looks like this:
You now need to add something to control the animation. You do this
by highlighting the children part of the cone and
inserting a touch sensor and then a route
element. Your screen should now look like this:
Then you double click on the route element at the bottom
of the screen (it has the route icon followed by the word FROM) and
configure the route editor as follows:
Click here to see the resulting animation.
|
||||
|
||||