Reference Guide > U–V Routines > VRML_CONE Procedure
  

VRML_CONE Procedure
Creates a VRML cone.
Usage
VRML_CONE
Input Parameters
None.
Keywords
Use these keywords to set the object properties and material properties.
Object Properties
The following keywords describe or define the VRML cone object.
Center—A 3-element array specifying the true center of the cone object. (Default: [0, 0, 0])
Height—Specifies the cone height (Default: 2.0)
Orientation—A 3-element array specifying the orientation of the cone (in the direction of the apex). (Default: cone axis orientation along y, with the apex at +y)
Radius—Specifies radius of the cone base from the y-axis. (Default: 1.0)
Transform—A 4-by-4 matrix containing the transformation to be applied to the cone object; similar to !P.T.
Material Properties
The following properties, when set, are applied to the object.
AmbientColor—3-element array of RGB color with each element ranging between 0 to 255. Scalar values are interpreted as grayscale.
DiffuseColor—A 3-element array of RGB color with each element ranging between 0 to 255. Scalar values are interpreted as grayscale.
EmissiveColor—A 3-element array of RGB color with each element ranging between 0 to 255. Scalar values are interpreted as grayscale.
Shininess—Scalar shininess factor, in the range from 0 to 255.
SpecularColor—A 3-element array of RGB color with each element ranging between 0 and 255. Scalar values are interpreted as grayscale.
Texture_Image—A texture image to apply to the object. The image is wrapped completely around the object. The texture image values and transparency values lie in the range of 0 to 255. 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, *, *)
Transparency—Scalar transparency factor, in the range of 0 to 255.
Discussion
The VRML_CONE procedure supports the cone node in VRML. The default cone has a base radius of 1.0 and a height of 2.0 such that it extends +1.0 and –1.0 in each direction from the object center.
Example
The 'wavelogo.dat' file used in this example is found in the following directory:
(UNIX) <wavedir>/demo/web/vrml
(WIN) <wavedir>\demo\web\vrml
where <wavedir> is the main PV‑WAVE directory.
VRML_OPEN, 'vrml_cone.wrl'
x = [0, 1, 2, 3, 4]
y = [0, 1, 0, 1, 0]
z = [4, 3, 2, 1, 0]
RESTORE, 'wavelogo.dat' ; img, r, g, b
sz = SIZE(img)
col = TRANSPOSE([[r], [g], [b]])
img24 = REFORM(col(*, img), 3, sz(1), sz(2))
; Create texture and default cone.
VRML_CONE
VRML_CONE,Center = [0, 3, 0], Radius = .4, $
   Height = 4.0, Texture = img24
; Create and view the textured cone.
VRML_CONE,Center = [2, 0, 0], Radius = 1.4, Height = 1.2, $
   DiffuseColor = [127, 255, 191], AmbientColor = [55, 70, 60], $
   SpecularColor = [0, 100, 0]
VRML_CLOSE
See Also
VRML_CUBE, VRML_CYLINDER, VRML_OPEN, VRML_SPHERE, VRML_TEXT
For a discussion of cones 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.