Home

If you're new to Python
and VPython see more
Help at glowscript.org

Pictures of 3D objects

 
cone
cone

cone The cone object has a circular cross section and tapers to a point. The following statement will display a cone with the center of its circular base at (5,2,0), pointing parallel to the x axis with length 12; the wide end of the cone has radius 1:

cone(pos=vector(5,2,0),
     axis=vector(12,0,0),
     radius=1)

The cone object has the following attributes and default values, like those for cylinders: pos vector(0,0,0), axis vector(1,0,0), length (1), color (1,1,1) which is color.white, red (1), green (1), blue (1), opacity (1), shininess (0.6), emissive (False), texture, and up vector(0,1,0). As with cylinders, up has only a subtle effect on the 3D appearance of a cone unless a non-smooth texture is specified or the cross section is oval. Additional cone attributes:

radius Radius of the wide end of the cone, default = 1

size Instead of specifying length and radius, you can
set size=vector(length,height,width), which means
that the cross section of the cone can be elliptical,
which is not currently possible in classic VPython

Note that the pos attribute for cylinder, arrow, cone, and pyramid corresponds to one end of the object, whereas for a box, sphere, or ring it corresponds to the center of the object.

If you include make_trail=True when you create the object, a trail will be left behind the object as you move it. For related options, see Leaving a Trail.

See Rotating an Object for an easy way to change the orientation of an object.

See description of Additional Attributes available for all 3D display objects.