Draw a sphere.

This function draws a sphere with its center at the origin (0,0,0).

syntax

sphere(radius)

parameters

radius radius of sphere

optional arguments

style rendering style: "wireframe" (default) or "solid"
texture Texture object(s)

examples

draw a wireframe sphere

def display():
   lighting(False)
   color(1.0, 1.0, 1.0)
   sphere(3.0)

draw a solid sphere

def display():
   lighting(True)
   material(1.0, 1.0, 1.0)
   sphere(3.0, style='solid')

draw a texture-mapped sphere

def gl_init():
   Global.texture = Texture.from_file('data/globe.png')   

def display():
   lighting(True)
   material(white)
   sphere(3.0, texture=Global.texture)