In this exercise you will build a ribbon that follows a helical path. Next you will twist that ribbon, then add an arrow to the end.
In visualization, twisting, curving ribbons are often used to indicate the path along which an object travels, such as in a fluid flow visualization. Arrows on the ends of the ribbons indicate the direction of movement.
This exercise focuses upon use of Extrusion nodes.
The program uses an Extrusion node to create a ribbon. A flat, 2D rectangle is used as the extrusion cross-section. The path of the ribbon is described by a list of 3D coordinates in the extrusion spine.
View the resulting VRML scene by loading the "ribbon.wrl" file into your browser.
SOLUTION: ribbon.wrl
The initial ribbon shows a helical path of a particle. To indicate the orientation of the particle along the path, you can add a twist to the path. Your task is to modify the ribbon1.c program to twist the ribbon by rotating the cross-section at each spine point.
HINT: You need to produce the same number of orientation values as you have spine values.
HINT: One possible rotation angle sequence could be computed using:
HINT: You will want to specify a constant orientation vector that points toward the positive Y axis (0.0 1.0 0.0) but a rotation amount that varies with theta.
SOLUTION: ribbon1.c, ribbon1.wrl
Extra credit: The ribbon in the previous task now shows a particle path and orientation, but not which direction the particle is traveling along the path. Your task is to modify the ribbon2.c program to add an arrow head at the end of the ribbon.
HINT: Extrusion scale values are 2D not 3D.
HINT: A scale value of "1.0 1.0" does no scaling at a spine point.
HINT: In order to get a "sharp" angle in an extruded shape, you need to repeat (add) a spine point (ie: two identical points).
HINT: You need the same number of scale values as spine values:
HINT: A nice scale factor for the provided cross section is "1.5 1.5" for the arrow base and "0.0 0.0" for the arrow tip.
SOLUTION: ribbon2.c, ribbon2.wrl