cmss Listing 3

s1 = vrml_frame ("scale",[1 2 3],"col",eye (3), "hcol",0.5*[1 1 1]); 
s2 = vrml_Background ("skyColor",[3 3 9]/10,"groundColor",[3 8 3]/10); 
vrml_browse ([s1,s2]);
We now describe the function

s = vrml_cyl (x,...)
that returns VRML code representing 3D line segments (in fact, cylinders) whose extremities are [x(:,i),x(:,i+1)], for i in \( \left\{ 1,..,N\right\} \) (x is a a \( 3\times N \) matrix). Amongst other things, the radius, color and transparency can be set. Also, spheres centered at each x(:,i) can be added, and an arrow can be used to indicate the last segment. The corresponding options are :

"rad", rad
The radius of the cylinders linking each pair of consecutive points.
"col", col
\( 3\times 1 \) or \( 3\times N \) The RGB color(s) of the cylinders.
"tran", col
The transparency of the cylinders.
"balls"
Add a spheres around each x(:,i).
"arrow"
Represent the last segment as an arrow.



Søren Hauberg 2009-06-07