# Graphics3D

Graphics3D[primitives,options]

represents a three-dimensional graphical image.

# Details and Options

• Graphics3D is displayed in StandardForm as a graphical image. In InputForm, it is displayed as an explicit list of primitives.
• The following graphics primitives can be used:
•  Arrow[{pt1,pt2}] arrow Ball[{x,y,z},…] filled ball BezierCurve[{pt1,pt2,…}] Bézier curve BSplineCurve[{pt1,pt2,…}] B-spline curve BSplineSurface[array] B-spline surface Circumsphere[{pt1,…}] sphere specified by four points Cone[{pt1,pt2},r] filled cone ConicHullRegion[…] filled linear cone Cuboid[{xmin,ymin,zmin},…] filled cuboid Cylinder[{{x1,x2,x3},…},…] filled cylinder GraphicsComplex[pts,prims] complex of graphics objects GraphicsGroup[{g1,g2,…}] objects treated as a group HalfLine[{pt1,pt2}] half-infinite line, or ray HalfPlane[{pt1,pt2},v] half-infinite plane Hexahedron[{pt1,…}] filled hexahedron InfiniteLine[{pt1,pt2}] infinite line InfinitePlane[{pt1,pt2,pt2}] infinite plane Inset[obj,…] inset object JoinedCurve[{seg1,seg2,…}] joined curve segments Line[{pt1,…}] line Parallelepiped[pt,{v1,…}] parallelepiped Point[{x,y,z}] point Polygon[{pt1,…}] polygon Prism[{pt1,…}] prism Pyramid[{pt1,…}] pyramid Raster3D[array] cubical array of gray or colored cells Simplex[{pt1,…}] simplex Sphere[{x,y,z},…] sphere Tetrahedron[{pt1,…}] filled tetrahedron Text[expr,{x,y,z}] text Triangle[{pt1,…}] triangle Tube[{pt1,…}] tube
• The following graphics directives can be used:
•  AbsoluteDashing[{w1,…}] absolute line dashing specification AbsolutePointSize[d] absolute point size specification AbsoluteThickness[w] absolute line thickness specification Arrowheads[spec] arrowheads specification CMYKColor[c,m,y,k] color specification CapForm[type] tube and line cap specification Dashing[{w1,…}] line dashing specification Directive[g1,g2,…] composite graphics directive EdgeForm[spec] polygon edge specification FaceForm[spec] polygon face specification Glow[c] glow color specification GrayLevel[i] gray‐level specification Hue[h] hue specification JoinForm[type] tube and line joining specification Opacity[a] opacity specification PointSize[d] point size specification RGBColor[r,g,b] color specification Specularity[s] surface specularity specification Texture[obj] texture specification Thickness[w] line thickness specification
• The following wrappers can be used at any level:
•  Annotation[obj,label] give an annotation Button[obj,action] make obj act as a button Dynamic[obj] use the dynamically updated current value EventHandler[obj,…] attach an event handler Hyperlink[obj,URI] make obj a hyperlink Mouseover[obj,over] specify a mouseover form PopupWindow[obj,cont] attach a popup window StatusArea[obj,label] specify a label to appear in the status area Style[obj,opts] specify a style Tooltip[obj,label] attach a tooltip
• The following options can be given:
•  AlignmentPoint Center the default point in the graphic to align with AspectRatio Automatic ratio of height to width Axes False whether to draw axes AxesEdge Automatic on which edges to put axes AxesLabel None axes labels AxesOrigin Automatic where axes should cross AxesStyle {} graphics directives to specify the style for axes Background None background color for the plot BaselinePosition Automatic how to align with a surrounding text baseline BaseStyle {} base style specifications for the graphic Boxed True whether to draw the bounding box BoxRatios Automatic bounding 3D box ratios BoxStyle {} style specifications for the box ClipPlanes None clipping planes ClipPlanesStyle Automatic style specifications for clipping planes ContentSelectable Automatic whether to allow contents to be selected ControllerLinking Automatic when to link to external rotation controllers ControllerMethod Automatic how external controllers should operate ControllerPath Automatic what external controllers to try to use Epilog {} 2D graphics primitives to be rendered after the main plot FaceGrids None grid lines to draw on the bounding box FaceGridsStyle {} style specifications for face grids FormatType TraditionalForm default format type for text ImageMargins 0. the margins to leave around the graphic ImagePadding All what extra padding to allow for labels, etc. ImageSize Automatic absolute size at which to render the graphic LabelStyle {} style specifications for labels Lighting Automatic simulated light sources to use Method Automatic details of 3D graphics methods to use PlotLabel None a label for the plot PlotRange All range of values to include PlotRangePadding Automatic how much to pad the range of values PlotRegion Automatic final display region to be filled PreserveImageOptions Automatic whether to preserve image options when displaying new versions of the same graphic Prolog {} 2D graphics primitives to be rendered before the main plot RotationAction "Fit" how to render after interactive rotation SphericalRegion False whether to make the circumscribing sphere fit in the final display area Ticks Automatic specification for ticks TicksStyle {} style specification for ticks TouchscreenAutoZoom False whether to zoom to fullscreen when activated on a touchscreen ViewAngle Automatic angle of the field of view ViewCenter Automatic point to display at the center ViewMatrix Automatic explicit transformation matrix ViewPoint {1.3,-2.4,2.} viewing position ViewRange All range of viewing distances to include ViewVector Automatic position and direction of a simulated camera ViewVertical {0,0,1} direction to make vertical
• Nested lists of graphics constructs can be given. Directive specifications such as GrayLevel remain in effect only until the end of the list that contains them.
• Style[obj,opts] can be used to apply the options or directives opts to obj.
• In a notebook front end, ViewPoint, ViewVertical, ViewCenter, and ViewAngle can be changed by direct interactive manipulation.
• Dragging with the mouse rotates a 3D graphic.
• Directives such as RGBColor specify surface colors for objects that follow. Final colors are determined from simulated illumination, including Glow and Specularity components.
• By default, four light sources of different colors are used, arranged at particular fixed locations outside the bounding box.
• By default, ViewAngle is set so that, if possible, the projection of the whole 3D object just fills the 2D viewing area.
• The settings for BaseStyle are appended to the default style typically given by the "Graphics3D" style in the current stylesheet. The settings for BoxStyle, LabelStyle, etc. are appended to the default styles given for "Graphics3DBox", "Graphics3DLabel", etc.
• Settings that can be given through the Method option include "SpherePoints", "CylinderPoints", "RotationControl", and "ShrinkWrap". »
• gives an empty 3D graphic.

# Examples

open allclose all

## Basic Examples(3)

Use lines, polygons, cylinders, spheres, etc. to build up a 3D graphics scene:

 In[1]:=
 Out[1]=

Use plot functions to automatically create Graphics3D from different types of data:

 In[1]:=
 Out[1]=
 In[2]:=
 Out[2]=

Use built-in polyhedron data:

 In[1]:=
 Out[1]=