Package Scientific :: Package Visualization :: Module VRML2
[frames] | no frames]

Module VRML2

Definitions of simple 3D graphics objects and VRML scenes containing them

The objects are appropriate for data visualization, not for virtual reality modelling. Scenes can be written to VRML files or visualized immediately using a VRML browser, whose name is taken from the environment variable VRML2VIEWER (under Unix).

This module uses the VRML 2.0 definition, also known as VRML97. For the original VRML 1, use the module VRML, which uses exactly the same interface.

Example:

 >>> from Scientific.Visualization.VRML import *    
 >>> scene = Scene([])
 >>> scale = ColorScale(10.)
 >>> for x in range(11):
 >>>     color = scale(x)
 >>>     scene.addObject(Cube(Vector(x, 0., 0.), 0.2,
 >>>                          material=Material(diffuse_color = color)))
 >>> scene.view()
Classes
  Arrow
Arrow
  Camera
Camera/viewpoint for a scene
  Cone
Cone
  Cube
Cube
  Cylinder
Cylinder
  Group
Base class for composite objects
  Line
Line
  LinearOrientedObject
  Material
Material specification for graphics objects
  NavigationInfo
Navigation information
  PolyLines
Multiple connected lines
  Polygons
Polygons
  Scene
VRML scene
  SceneFile
  ShapeObject
Graphics objects representing geometrical shapes
  Sphere
Sphere
  VRMLFile
  VRMLObject
Graphics object for VRML
Functions
Material
DiffuseMaterial(color)
Returns: a material with the 'diffuse color' attribute set to color
Material
EmissiveMaterial(color)
Returns: a material with the 'emissive color' attribute set to color
 
isGroup(x)
Variables
  ex = Vector(1.000000,0.000000,0.000000)
  ey = Vector(0.000000,1.000000,0.000000)
  ez = Vector(0.000000,0.000000,1.000000)
Function Details

DiffuseMaterial(color)

 
Parameters:
  • color (Color or str) - a color object or a predefined color name
Returns: Material
a material with the 'diffuse color' attribute set to color

EmissiveMaterial(color)

 
Parameters:
  • color (Color or str) - a color object or a predefined color name
Returns: Material
a material with the 'emissive color' attribute set to color