Module VMD
Definitions of simple 3D graphics objects and scenes containing them,
in a form that can be fed to the molecular visualization program VMD
Scenes can either be written as VMD script files, or visualized
directly by running VMD.
This module is almost compatible with the modules VRML and VRML2,
which provide visualization by VRML browsers. There is no Polygon class,
and the only material attribute supported is diffuse_color. Note also
that loading a scene with many cubes into VMD is very slow, because each
cube is represented by 12 individual triangles.
Example:
>>> from VMD 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()
|
ex = Vector(1.000000,0.000000,0.000000)
|
|
ey = Vector(0.000000,1.000000,0.000000)
|
|
ez = Vector(0.000000,0.000000,1.000000)
|
- 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
|
- 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
|