Vector Field
Exercise


Description


VRML Concepts

Files

Tasks

  1. Create and edit a new VRML file named "vector1.wrl".

    In "vector1.wrl", build a flat arrow-shape using an IndexedFaceSet geometry node. Make the arrow conform to the following specifications:

    SOLUTION: vector1.wrl


  2. Copy your "vector1.wrl" file to "vector2.wrl" and edit it.

  3. Your task is to duplicate the arrow you just created. The original and the duplicate should be placed into the same VRML file. The duplicate should be rotated around the Y axis by 90 degrees. The pair of arrows will intersect down the middle of the arrow.

    SOLUTION: vector2.wrl


  4. Copy your "vector2.wrl" file to "vector3.wrl" and edit it.

    To build a vector field you're going to need dozens of arrows, all with approximately the same shape. Wouldn't it be nice if there was a Vector node? Your task is to modify the "vector3.wrl" file to create a Vector node. Add a PROTO wrapper around the vector shape. Make sure that it conforms to the following specifications:

    You can test your new Vector node by temporarily adding a line to the end of your file, like this:

    Try adding translation, scale, rotation, and color fields and values to your Vector node test.

    SOLUTION: vector3.wrl


  5. Copy your "vector3.wrl" file to "vector.wrl" and edit it. Remove your test node (if any) from the bottom the file after your Vector PROTO.

    Load "vecfld1.wrl". This file contains an EXTERNPROTO that looks in your "vector.wrl" file and loads your Vector node PROTO. The vector field file then uses your node to create a 3D block of arrows, all pointing in different directions.

    SOLUTION: vecfld1.wrl