sphere

_images/sphere.jpg
sphere(pos=vec(0, 0, 0), radius=2, color=color.cyan)
Parameters:
  • pos (vector) – Position of center. Default <0,0,0>.

  • radius (scalar) – Default 1.

  • color (vector) – Default color.white

  • size (vector) – Dimensions of a box surrounding the sphere. Default <2,2,2>.

  • axis (vector) – Default <1,0,0>

A sphere can be made into an ellipsoid by assigning an asymmetrical size.

Attributes used less often:

sphere(opacity=0.5, shininess=0.2, texture=textures.wood, make_trail=True, canvas=mycanvas, emissive=False)
Parameters:
  • opacity (scalar) – Default 1.0; Range 0-1.

  • shininess (scalar) – Default 0.6; Range 0-1.

  • emissive (boolean) – Default False. Object glows, losing all shading, if True.

  • texture (class element or path) – Default None.

  • visible (boolean) – If False, object is not displayed. Default: True

  • canvas (object) – Default is scene.

  • make_trail (boolean) – If True, object leaves a trail when moved. See Attaching a Trail for more options.

  • up (vector) – A vector perpendicular to the axis.

  • group (object) – The group to which this object belongs.

Although a sphere does have axis and up attributes, these are not typically useful unless a texture has been applied to the sphere.

simple_sphere

In order to look smooth, a sphere is made of a very large number of triangles. Sometimes speed is more important than ultimate beauty. The simple_sphere object has many fewer triangles than a sphere. It can be used just like a sphere, but a large number of simple_sphere objects is displayed very much faster than the same number of regular spheres. For speed, the simple_sphere object is used in the points object and in trails that use points.