Additional Attributes

The following attributes apply to all VPython objects:

visible If false (0), object is not displayed; e.g. ball.visible = 0
Use ball.visible = 1 to make the ball visible again.

frame Place this object into a specified frame, as in ball = sphere(frame = f1)

display When you start a VPython program, for convenience Visual creates a display window and names it scene. By default, objects you create go into that display window. You can choose to put an object in a different display like this:

        scene2 = display( title = "Act IV, Scene 2" )
        rod = cylinder( display = scene2 )

 

__class__ Name of the class of object. For example, ball.__class__ == sphere is true (you can also refer to 'sphere' as a character string). There are two underscores before and after the word class. In a list of visible objects provided by scene.objects, if obj is in this list you can determine the class of the object with obj.__class__.

__members__ List of all the object's attributes; for example, ball.__members__ is ['axis', 'blue', 'color', .....]. There are two underscores before and after the word members.

See Controlling One or More Visual Display Windows for more information on creating and manipulating display objects.