plotttols,vrml - Maple Help
For the best experience, we recommend viewing online help using Google Chrome or Microsoft Edge.

Online Help

All Products    Maple    MapleSim


plottools

  

vrml

  

three-dimensional plotting in VRML

 

Calling Sequence

Parameters

Description

Options

Examples

References

Calling Sequence

vrml(plotstruct, file, options)

Parameters

plotstruct

-

PLOT or PLOT3D data structure

file

-

valid file name to write the resulting vrml code

options

-

(optional) equations of the form option=value where option is one of anchor, background_color, camera, directional_light, emissive_color, material_binding, point_light, scene_info, shininess, smooth_shading, specular_color, spot_light, texture, tickback_color, tickfore_color, or transparency

Description

• 

Important: The plottools[vrml] command has been deprecated. It may not support all possible plot structures. Use the export tools from the Standard GUI to export to the X3D format instead.

• 

The special file name 'default' writes the VRML data to the standard output. This is useful in conjunction with a POST command to a CGI script on a web server.

• 

Any additional arguments are interpreted as plot options specific to vrml.  Options are specified as equations of the form option = value. The following options are supported.

Options

  

In the following discussion 'Color' is referred to numerous times.  'Color' is a color as defined in plot[color] (that is, red, blue, green, orange, white...), or 'Color' is an RGB color definition (that is, COLOR(RGB, 1, 1, 1) -> white) or 'Color' is a HUE color definition (that is, COLOR(HUE, 0.9) -> violet) or 'Color' is an HSV color definition (that is COLOR(HSV, 0.1, 0.9, 1.0) -> red).

• 

 anchor=[obj_no_1=filename_1,...,obj_no_n=filename_n] 

  

This option links VRML worlds together on the World Wide Web. Using links, one can connect a door in one's world to another VRML world described elsewhere on the web. obj_no_i where 1<=i<=n is the ith argument of plot.  filename_i is the location of the VRML format file to be linked to obj_no_i.

• 

background_color=Color

  

This option sets background color.  If no background color is specified, the default is black.  This option may be specified only once.

• 

camera=name&comma;xpos&comma;ypos&comma;zpos&comma;xfrac&comma;yfrac&comma;zfrac&comma;angle

  

This option specifies a camera view point to view the VRML world.  The first camera defined is the default view point when the browser first loads the world.  Subsequent camera definitions can be selected by the user from the browser. name is a string containing no spaces and will appear as a name in the browser for selecting this camera.  xpos, ypos, and zpos are the coordinates of the camera's position. xfrac, yfrac, and zfrac compose a vector over which the camera is rotated by angle radians.

• 

directional_light=intensity&comma;Color&comma;xdir&comma;ydir&comma;zdir

  

Directional lights allow users to specify lights, which are positioned infinitely far away.  All light rays coming from the light source are parallel and point in the same direction.  In the real world, the sun is a directional light. intensity is a numeric which ranges from -1 to 1.  Negative values pull light from the scene.  The more negative the value, the more light is pulled from the world.  The more positive the value, the greater the intensity of the light source.  xdir, ydir, and zdir compose a vector that specifies the direction in which the light rays are pointed.  This option may be specified multiple times.

• 

emissive_color=Color

  

This option sets the color that the objects will radiate. emissive_color is useful for creating objects that appear to glow. This option can be specified only once.

• 

material_binding=binding

  

This option specifies how materials (colors) are bound to objects. binding takes two values: PER_VERTEX and PER_FACE.  PER_VERTEX means that each individual vertex has a color associated with it and polygons formed by these vertices have a color gradation that smoothly varies from one vertex to the next.  PER_VERTEX produces VRML files that are larger, more complex, but have better detail.  PER_FACE means that each polygon is given a solid color.  If material_binding is not specified, the default is PER_FACE.  This option can be specified only once.

• 

point_light=intensity&comma;Color&comma;x&comma;y&comma;z

  

A point light is a light emanating from a point source in the world from which light is radiated in all directions.  The intensity is a numeric ranging from -1 to 1. Negative values let you pull light out of the world and make it look darker. The more negative the value, the darker the scene becomes.  The more positive the value of the intensity is, the brighter the point light is. x, y, and z specify the point in the world which the point light is positioned.  This option may be specified multiple times.

• 

scene_info=string

  

This option specifies a string that the VRML browser will display when the user asks for information on the vrml file.  This option can be specified only once.

• 

shininess=value

  

This option specifies the level at which objects reflect their light sources.  value must be a numeric value in the range 0 to 1.  A 0 value means objects appear as dull and matte.  Higher values mean that objects appear more and more shiny.  If this option is not specified, the default is 0. This option can be specified only once.

• 

smooth_shading=value

  

When value is set to true, this option creates normals for each vertex of each face on a 3-D shape. By intentionally computing normals differently than those automatically computed by the VRML browser, one can make a faceted shape appear smooth. value is a boolean value, that is, true or false (the default is false). Note that this will take much more time and space when value is true.

• 

specular_color=Color

  

This option specifies the color that objects reflect by specular reflection. This controls the color of the highlight on shiny shapes. This option can be specified only once.  If this option is not specified the default is white.

• 

spot_light=intensity&comma;Color&comma;xpos&comma;ypos&comma;zpos&comma;xdir&comma;ydir&comma;zdir&comma;dr&comma;co

  

A spotlight defines a cone of light.  Objects within the cone are illuminated, while objects not inside the cone of light are not affected. intensity is a numeric that ranges from -1 to 1.  Negative values pull light out of the world while positive values illuminate the world. The greater the magnitude of the intensity, the more effect it has. xpos, ypos, and zpos are coordinates that specify the position of the tip of the cone in the world.  xdir, ydir, and zdir form a vector specifying the direction in which the cone radiates from the point. dr, the drop off rate, is a numeric in the range 0 to 1 that specifies the rate at which the intensity drops as we move from the center of the cone to an edge. A value of 0 for dr means that objects in the middle of the cone and objects at the edge of the cone are illuminated with equal intensities of light.  A value of 1 for dr means that objects in the middle of the cone are illuminated with full intensity, but objects near the edge of the cone are hardly illuminated at all. co, the cut off angle, gives the spread angle in radians of the cone of light.  co must be a numeric in the range 0..2*Pi.  This option can be specified multiple times.

• 

 texture=&lsqb;image=filename,coords=&lsqb;&lsqb;x1,y1&rsqb;,&lsqb;x2,y2&rsqb;,&lsqb;x3,y3&rsqb;,...&rsqb;,transform=translatex,y,rotatealpha,scalefactorS,T,centerx,y&rsqb; 

  

This option allows texture-mapping on the object. filename is the location of the image texture (for example, gif file); coords specifies a shape using a list of 2-D coordinates; translate, rotate, and scalefactor specify the transformations that are going to be applied to the image texture with respect to center (for rotate and scalefactor).

• 

tickback_color=Color

  

Tickmarks in VRML are presented as cubes with the value of the tickmark written on all six sides.  This option specifies the color of the cube. The default is off-white.  This option can be specified only once.

• 

tickfore_color=Color

  

This option specifies the color of the text used to inscribe the value of the tickmark on the cube.  The default is dark green. This option can be specified only once.

• 

transparency=value

  

This option specifies the transparency of objects. value must be a numeric in the range 0 to 1.  0 means the objects will be opaque.  1 means objects will be transparent.  Values between 0 and 1 cause objects to appear translucent.  This option can be specified only once.

  

Note: The transparency option is not available in all interfaces.

• 

The standard file extension for VRML data files is '.wrl'

Examples

Important: The plottools[vrml] command has been deprecated. It may not support all possible plot structures. Use the export tools from the Standard GUI to export to the X3D format instead.

withplottools&colon;

vrmlplot3dsinxy2&comma;x=π..π&comma;y=π..π&comma;axes=NORMAL&comma;lightmodel=light2&comma;`plot1.wrl`

vrmlplotx2&comma;x=2..2&comma;`plot2.wrl`&comma;scene_info=`x^2`

vrmlplot3dsinx2y2&comma;x=π2..π2&comma;y=π2..π2&comma;`plot3.wrl`&comma;background_color=COLORRGB&comma;1&comma;1&comma;1

3-D geometry objects are particularly interesting viewed from VRML

geom3dpointo&comma;0&comma;0&comma;0&colon;r1.&colon;

geom3dGreatRhombiicosidodecahedronp1&comma;o&comma;r&colon;

geom3ddualitydp1&comma;p1&comma;geom3dspheres1&comma;o&comma;geom3dMidRadiusp1

dp1

(1)

c1COLORRGB&comma;1.00&comma;0.50&comma;0.50&colon;c2COLORRGB&comma;0.50&comma;0.&comma;0.05&colon;

picgeom3ddrawp1color=c1&comma;dp1color=c2&comma;cutout=78&comma;lightmodel=light2&comma;orientation=0&comma;31&colon;

vrmlpic&comma;`Rhombii.wrl`&comma;shininess=0.5&comma;specular_color=COLORRGB&comma;1&comma;1&comma;1&colon;

3-D Parametric plot

c1cosx2cos0.4y&comma;sinx2sin0.4y&comma;y&colon;

c2cosx+2cos0.4y&comma;sinx+2sin0.4y&comma;y&colon;

c3cosx+2sin0.4y&comma;sinx2cos0.4y&comma;y&colon;

c4cosx2sin0.4y&comma;sinx+2cos0.4y&comma;y&colon;

picplot3dc1&comma;c2&comma;c3&comma;c4&comma;x=0..2π&comma;y=0..10&comma;grid=25&comma;15&comma;style=patch&comma;lightmodel=light4&colon;

vrmlpic&comma;`Tubes.wrl`&comma;transparency=0.5

plottools objects colored with lightsources

withplots&colon;

midpoint := proc(x)
     local v, n, g, i;
     v := [op(x),x[1] ];    n := nops( x );
     g := ( a, b) -> 1/2*( a + b ) :
     [ seq( g( v[i], v[i+1] ), i=1..n)];
end proc:

Conchoidtubeplott5πsint3&comma;t5πcost3&comma;t5π0.9&comma;t=0..5π&comma;radius=t5π0.2&comma;tubepoints=25&colon;

ConchoidPolysconvertop1&comma;Conchoid&comma;POLYGONS&colon;

vrmldisplaymapmidpoint&comma;ConchoidPolys&comma;scaling=constrained&comma;style=patchnogrid&comma;color=COLORRGB&comma;1&comma;1&comma;1&comma;`conchoid.wrl`&comma;point_light=1.0&comma;COLORRGB&comma;0&comma;0&comma;1&comma;0&comma;0&comma;20&comma;spot_light=1.0&comma;COLORRGB&comma;1&comma;1&comma;0&comma;40&comma;0&comma;7.5&comma;1&comma;0&comma;0&comma;0.8&comma;1.57&comma;spot_light=1.0&comma;COLORRGB&comma;0&comma;1&comma;1&comma;20.07&comma;34.6&comma;7.5&comma;20.07&comma;34.6&comma;0&comma;0.8&comma;1.57&comma;spot_light=1.0&comma;COLORRGB&comma;0&comma;1&comma;0&comma;20.07&comma;34.6&comma;7.5&comma;20.07&comma;34.6&comma;0&comma;0.8&comma;1.57&comma;directional_light=1.0&comma;COLORRGB&comma;1&comma;0&comma;0&comma;0&comma;0&comma;1

Apply smooth shading to the object

vrmlplot3dsinxy&comma;x=π..π&comma;y=π..π&comma;color=blue&comma;`sin.wrl`&comma;smooth_shading=true

Anchor option

Create a link

geom3dtetrahedront1&comma;geom3dpointo&comma;0&comma;0&comma;0&comma;1.&colon;

geom3dtetrahedront2&comma;o&comma;1.0001&colon;

vrmlgeom3ddrawt2&comma;t1&comma;tickmarks=3&comma;3&comma;3&comma;axes=frame&comma;`link.wrl`&comma;tickback_color=brown&comma;tickfore_color=yellow

Create the VRML world for the tetrahedron t with center (-2,2,1), radius of the circum-sphere 1., and link t1 to "link.wrl"

vrmlgeom3ddrawgeom3dtetrahedront&comma;geom3dpointo1&comma;2&comma;2&comma;1&comma;1.&comma;orientation=109&comma;52&comma;color=COLORRGB&comma;0.9335294125&comma;0.9129411760&comma;0.5205882350&comma;`main.wrl`&comma;anchor=1=link.wrl

References

  

The VRML Sourcebook. New York: John Wiley & Sons, 1996.

See Also

examples/geometry

exportplot

geometry

geometry[draw]

plot

plot3d

plot3d[coords]

plot3d[option]

plot3d[structure]

plot[color]

plots