Interface

Dolphin {
  eventIn      SFFloat set_fraction
  exposedField SFBool  collide      TRUE
  eventOut     SFTime  collideTime
}

Description

The dolphin gets its groove on.
Dolphin Preview

I had very little to do with the creation of this PROTO. The dolphin started as a set of models at Viewpoint Datalabs' Avalon archive. Bob Crispen, who maintains the VRMLWorks pages, recognized that the models were sequences in a keyframe animation and assembled them into an animated dolphin using a CoordinateInterpolator node. I thought the dolphin was pretty nifty and wanted to use it to demonstrate some of my PROTOs here, but to make it easy to use I turned it into a PROTO first. I decided to present a description of it mostly for the purpose of completeness, but it also gives me an opportunity to point out some Good Ideas that can be used generally when wrapping a model as a PROTO.

Since the model encapsulates both the initial geometry and the CoordinateInterpolator, all it needs is a set_fraction eventIn to get it going. This eventIn can be directly wired to a TimeSensor (or other source of fraction_changed-style events).

The PROTO also includes a Collision node, and mappings to its interface have been included in the PROTO's interface. It is usually a good idea to include a collision proxy in the proxy field of the Collision node. A collision proxy is non-rendered geometry that the browser can optionally use to test for collisions instead of using the rendered geometry. Thus the collision proxy geometry should be less complex than the rendered geometry. This model, however, does not include a collision proxy because I don't have the tools it would take to make a decent one. The fact that this model is animated potentially increases the complexity of creating collision proxy geometry. It may be in some cases adequate (even optimal) to provide collision proxy geometry that is static. But since this may not be a universally desirable solution, the creation of appropriate collision proxy geometry (if any) is left as an exercise for the reader. (Don'cha hate those?)

Last, but certainly not least, since this PROTO isn't really mine at all, ask Bob if you want to use it somewhere.

Download