VRML Scripting Animation and Gravity
VRML scripting is rather robust. Think javascript and you are already most of the way there. You will need to learn about ROUTEs in VRML. It's a mouthful and i generally learn by example.
Here are some examples of vrml scripting a gravity effect. These go from simple to more complicated.
All are done 100% with vrml scripting. vrmlscript and javascript work in much the same way as a node call. Your routes can transmit messages to and from these functions for some cool effects. In these examples, a yellow box is used, a more complicated mesh can be replaced for the box. Feel free to download these examples, modify and improve.
- 3D / Animated Flame - An animated fire with flame.
- 3D / Gravity 1 - Hello World - The Rise and Fall of a simple box.
- 3D / Gravity 2 - Text Output - A debugging output with live text updates as gravity runs its course.
- 3D / Gravity 3 - Weight - In this example, the red box is "heavier" than the yellow, actually it just falls slower.
- 3D / Gravity 4 - Bounce - 5 objects with a bounce simple.
- 3D / Gravity 5 - Ground - 5 objects with a more graceful bounce and a dynamic moving ground. You can drag the ground (zero point for the boxes) up or down.
- 3D / Gravity 6 - Variable Ground - Object senses what it is on top off and only falls to that point. Drag the red box up in the air and let go. it will stop on the top step. Move it to the left, it stops on the second step.
- 3D / Gravity 7 - Object gravity - building off Gravity 6, we use the entire bounding box of our shape to determine a collision with a shelf ala computeRayHit().
- 3D / Gravity 8 - Object gravity smarter - building off Gravity 7, we use the entire bounding box of our shape as above but we compute our atom's bounding box for the first time.
- 3D / Simple Atom - More developed standalone particle.
- 3D / Atom Proto - Standalone prototype atom and moveable ground. Sadly, atoms move with ground only after they have landed.
|