Tom Kaye's VRML Widgets

Demos Widgets Experiments Tutorials Links Home

NOTE: Unless otherwise indicated, this content has only been tested on various flavors of SGI's CosmoPlayer.

Useful VRML 2.0 Components
(Widgets, VRMLScripts, and Prototypes)

The following are reusable components that make worldbuilding quicker and easier.
Widgets are little code snippets or scripts that are not viable standalone VRML files. Their filenames end in .wdg) Widget links will load as text files in a browser.
To see how a widget works within a VRML world, click on one of its Examples under the "Description" column.

Components that are viable standalone VRML files have the standard .wrl extensions.

For CosmoWorlds 1.0.1 users, the downloaded components can be drag-N-drop added to your scenes the same as the standard widgets supplied under File->Open Gallery View.

Component/Widget Type Description
TrackingViewpoint
withProto.wdg
PROTO and
Widget

(3/27/97)
This Proto is a wrapper around a standard VRML 2.0 Viewpoint Node that allows viewpoint specification using:

  • position (where the eye is),
  • toVector (where the target is),
  • upVector (The top of the viewpoirt stays perpendicular to upVector),
  • Click HERE details and examples.
    TrackingViewpoint InstanceOnly.wdg Widget For CosmoWorlds users:
    After dragNdrop of the first instance of a Tracking Viewpoint (TrackingViewpointWithProto.wrl) all subsequent instances should be created by dragNdrop of TrackingViewpointInstanceOnly.wrl since the PROTO definition has already been added to your world.
    motionTrail.wdg Widget

    Feed in a series of Vec3f coordinates and this widget will generate an IndexedLineSet tail of a given length. In addition, it will compute tangential orientation and velocity at the end of the tail.

    Examples:

    HUD_example.wrl Widget

    This is a boilerplate implementation of a Heads Up Display

    Example

    offsetScript.wdg VRMLScript

    Useful when an SFVec3f eventOut needs to be offset by (dx, dy, dz) before being ROUTED to some other SFVec3f eventIn

    Example: Offset the TrackingViewpoint from an moving object's center point so the object's geometry doesn't block your view.
    wingtipCoordinates
    Script.wdg
    VRMLScript

    Given a position and orientation of a transformNode (say the parent transform of an aircraft), this script will generate absolute coordinates for points relative to the transformNode (say wingtips of the aircraft).

    When combined with two motionTrail.wdg widgets above, this allows you to generate wingtipTrails of an aircraft knowing nothing more than it's position, orientation, and relative location of the wingtips.

    Example:

    booleanTrigger
    Script.wdg
    VRMLScript Read comments embedded in script
    ZeroValueTrigger
    Script.wdg
    VRMLScript Read comments embedded in script
    fractionInverter
    Script.wdg
    VRMLScript Read comments embedded in script
    enterWorldTimeSensor.wdg Widget & VRMLScript Read comments embedded in script


    Feedback to: tomk@sgi.com

    Back to Tom Kaye's VRML Resources