VRML_CYLINDER Procedure
Positions a VRML cylinder in the world.
Usage
VRML_CYLINDER
Input Parameters
None.
Keywords
Use the following keywords to set the object properties and material properties.
Object Properties
The following keywords describe or define the VRML cylinder object.
Bottom—Displays the bottom of the cylinder only. (Default: set)
note | The default setting for each of the Bottom, Sides, and Top keywords is set, unless one or more of those keywords is explicitly specified. See the Discussion for more information. |
Center—A 3-element array specifying the true center of the cylinder object. (Default: [0, 0, 0])
Height—Specifies the cylinder height. (Default: 2.0)
Orientation—A 3-element vector specifying the orientation of the cylinder. (Default: along the y-axis)
Radius—Specifies the cylinder radius from the axis. (Default: 1.0)
Sides—Displays sides of the cylinder. (Default: set)
Top—Displays the top of the cylinder. (Default: set)
Transform—A 4-by-4 matrix containing the transformation to be applied to the object.
Material Properties
The following properties, when set, are applied to the object.
AmbientColor—A 3-element array of RGB color with each element between 0 and 255. If the value is scalar, the color is interpreted as grayscale.
DiffuseColor—A 3-element array of RGB color with each element between 0 and 255. If the value is scalar, then the color is interpreted as grayscale.
EmissiveColor—A 3-element array of RGB color with each element between 0 and 255. If the value is scalar, then the color is interpreted as grayscale.
Shininess—Scalar shininess factor, in the range of 0 to 255.
SpecularColor—A 3-element array of RGB color with each element between 0 and 255. If the value is scalar, then the color is interpreted as grayscale.
Texture_Image—A texture image to apply to the object. There are four options:
(
w, h) or (1,
w, h)—Grayscale image
(2,
w, h)—Grayscale in (0
, *, *) plus transparency in (1,
*, *)
(3
, w, h)—True color image (red, green, blue)
(4
, w, h)—True color plus transparency in (3
, *, *)
The image is wrapped completely around the object. The texture image values and transparency values lie in the range of 0 to 255.
Transparency—Scalar transparency factor, in the range of 0 to 255.
Discussion
The VRML_CYLINDER procedure supports the cylinder node in VRML.
The Bottom, Sides and Top keywords all refer to the viewed (solid) surfaces of the cylinder. If none of the keywords is explicitly specified, the cylinder appears as a closed solid object. If any of these keywords are specified, the walls corresponding to the keywords are the only solid walls displayed; the non-specified surfaces do not appear. For example, If Sides is specified, then neither the top nor the bottom of the cylinder is displayed, and the cylinder appears to be a hollow tube.
Example
The cylinder appears as a solid object in this example, because none of the surface viewing keywords (Bottom, Sides, or Top) was specified.
VRML OPEN, 'vrlm_cyldr.wld'
VRML_CYLINDER, Center=[10, 11.5, -10], Orientation=[0, 1, 0], $
Radius = 0.4, Height = 0.5, DiffuseColor = [160, 160, 0]
VRML_CLOSE
See Also
For a discussion of cylinders and other VRML primitives, see The VRML Sourcebook, by Andrea L. Ames, et al., John Wiley & Sons, Inc., 1996, Chapter 3.
Version 2017.0
Copyright © 2017, Rogue Wave Software, Inc. All Rights Reserved.