Creates a sphere in a VRML world.
Center A 3-element array specifying the center of the sphere object. (Default: 0, 0, 0)
Radius Specifies the sphere radius from the center. (Default: 1.0)
Transform A 4-by-4 matrix containing the transformation to be applied to the object.
AmbientColor A 3-element array of RGB color with each element ranging between 0 and 255. If the value is scalar, then the color is interpreted as grayscale.
DiffuseColor A 3-element array of RGB color with each element ranging 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 ranging between 0 and 255. If the value is scalar, then the color is interpreted as grayscale.
Shininess A scalar shininess factor, in the range of 0 to 255.
SpecularColor A 3-element array of RGB color with each element ranging 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. The texture image is wrapped completely around object (CLAMPed). Image values and transparencies lie in range of 0 to 255.
There are four options:
(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, *, *)
'wavelogo.dat'
file used in this example is found in the following directory:
wavedir/demo/web/vrml
wavedir:[DEMO.WEB.VRML]
wavedir\demo\web\vrml
wavedir
is the main PV-WAVE directory.
VRML_OPEN, 'vrml_sphere.wrl' RESTORE, 'wavelogo.dat' ; img, r, g, b sz = SIZE(img) col = TRANSPOSE([[r], [g], [b]]) texture = REFORM(col(*, img), 3, sz(1), sz(2)); Create the texture, using the PV-WAVE logo.
VRML_SPHERE; Create a base sphere.
VRML_SPHERE, Center = [-2, -1, 0], Radius =.5, $ Texture = texture; Create a textured sphere.
VRML_SPHERE, Center = [2, 0, 2], Radius = 1.5, $ Shininess = 202, Transparency = 170; Create a somewhat transparent, reflective sphere.
VRML_CLOSE