Wolfram Archive
Wolfram Programming Lab is a legacy product.
All the same functionality and features, including access to Programming Lab Explorations, are available with Wolfram|One.
Start programming now. »
Try it now »
(no sign-in required)

Draw a Sphere

Get started with 3D graphics by creating a single sphere.

Run the code to draw a sphere. Drag to rotate it:

SHOW/HIDE DETAILS

Draw a default, 3D Sphere. Mouse down in the graphic and drag to rotate the image:

Graphics3D[Sphere[]]

HIDE DETAILS
Graphics3D[Sphere[]]

Set the color of the sphere. Try other colors, like Orange or Blue:

SHOW/HIDE DETAILS

Make the sphere red. Put the color and sphere in a list (indicated by the curly braces):

Graphics3D[{Red, Sphere[]}]

HIDE DETAILS
Graphics3D[{Red, Sphere[]}]

Make the sphere partly transparent. Try other values of opacity:

Note: opacity values should be between 0 and 1.

SHOW/HIDE DETAILS

Make the sphere 50% opaque (which is 50% transparent):

Graphics3D[{Red, Opacity[.5], Sphere[]}]

HIDE DETAILS
Graphics3D[{Red, Opacity[.5], Sphere[]}]