此为 Mathematica 4 文档,内容基于更早版本的 Wolfram 语言
查看最新文档(版本11.1)

Graphics3D

Usage

Graphics3D[primitives, options]表示一个三维图形.


Notes

Graphics3D使用Show显示.
• 可以使用下列图形指令:
"\!\(\*StyleBox[\"\\\"Cuboid[\\\"\", \"MR\"]\)"{"\!\(\*StyleBox[\"\\\"xmin\\\"\", \"TI\"]\)\!\(\*StyleBox[\"\\\",\\\"\", \"MR\"]\) \!\(\*StyleBox[\"\\\"ymin\\\"\", \"TI\"]\)\!\(\*StyleBox[\"\\\",\\\"\", \"MR\"]\) \!\(\*StyleBox[\"\\\"zmin\\\"\", \"TI\"]\)"}"\!\(\*StyleBox[\"\\\",\\\"\", \"MR\"]\) ... \!\(\*StyleBox[\"\\\"]\\\"\", \"MR\"]\) "立方体
"\!\(\*StyleBox[\"\\\"Line[\\\"\", \"MR\"]\)"{{"\!\(\*StyleBox[\"\\\"x\\\"\", \"TI\"]\)"1"\!\(\*StyleBox[\"\\\",\\\"\", \"MR\"]\) ""\!\(\*StyleBox[\"\\\"y\\\"\", \"TI\"]\)"1"\!\(\*StyleBox[\"\\\",\\\"\", \"MR\"]\) ""\!\(\*StyleBox[\"\\\"z\\\"\", \"TI\"]\)"1}"\!\(\*StyleBox[\"\\\",\\\"\", \"MR\"]\) ... "}"\!\(\*StyleBox[\"\\\"]\\\"\", \"MR\"]\) """线
"\!\(\*StyleBox[\"\\\"Point[\\\"\", \"MR\"]\)"{"\!\(\*StyleBox[\"\\\"x\\\"\", \"TI\"]\)\!\(\*StyleBox[\"\\\",\\\"\", \"MR\"]\) \!\(\*StyleBox[\"\\\"y\\\"\", \"TI\"]\)\!\(\*StyleBox[\"\\\",\\\"\", \"MR\"]\) \!\(\*StyleBox[\"\\\"z\\\"\", \"TI\"]\)"}"\!\(\*StyleBox[\"\\\"]\\\"\", \"MR\"]\) ""点"
"\!\(\*StyleBox[\"\\\"Polygon[\\\"\", \"MR\"]\)"{{"\!\(\*StyleBox[\"\\\"x\\\"\", \"TI\"]\)"1"\!\(\*StyleBox[\"\\\",\\\"\", \"MR\"]\) ""\!\(\*StyleBox[\"\\\"y\\\"\", \"TI\"]\)"1"\!\(\*StyleBox[\"\\\",\\\"\", \"MR\"]\) ""\!\(\*StyleBox[\"\\\"z\\\"\", \"TI\"]\)"1}"\!\(\*StyleBox[\"\\\",\\\"\", \"MR\"]\) ... "}"\!\(\*StyleBox[\"\\\"]\\\"\", \"MR\"]\) "多边形
"\!\(\*StyleBox[\"\\\"Text[\\\"\", \"MR\"]\)\!\(\*StyleBox[\"\\\"expr\\\"\", \"TI\"]\)\!\(\*StyleBox[\"\\\",\\\"\", \"MR\"]\) "{"\!\(\*StyleBox[\"\\\"x\\\"\", \"TI\"]\)\!\(\*StyleBox[\"\\\",\\\"\", \"MR\"]\) \!\(\*StyleBox[\"\\\"y\\\"\", \"TI\"]\)\!\(\*StyleBox[\"\\\",\\\"\", \"MR\"]\) \!\(\*StyleBox[\"\\\"z\\\"\", \"TI\"]\)"}"\!\(\*StyleBox[\"\\\"]\\\"\", \"MR\"]\) "文本
• 声音指令SampledSoundListSampledSoundFunction也可以被包含.
• 可以使用下列图形指令:
"\!\(\*StyleBox[\"\\\"AbsoluteDashing[\\\"\", \"MR\"]\)"{"\!\(\*StyleBox[\"\\\"w\\\"\", \"TI\"]\)"1"\!\(\*StyleBox[\"\\\",\\\"\", \"MR\"]\) ... "}"\!\(\*StyleBox[\"\\\"]\\\"\", \"MR\"]\) """绝对线型指定
"\!\(\*StyleBox[\"\\\"AbsolutePointSize[\\\"\", \"MR\"]\)\!\(\*StyleBox[\"\\\"d\\\"\", \"TI\"]\)\!\(\*StyleBox[\"\\\"]\\\"\", \"MR\"]\) ""绝对点尺寸指定"
"\!\(\*StyleBox[\"\\\"AbsoluteThickness[\\\"\", \"MR\"]\)\!\(\*StyleBox[\"\\\"w\\\"\", \"TI\"]\)\!\(\*StyleBox[\"\\\"]\\\"\", \"MR\"]\) "绝对线宽指定
"\!\(\*StyleBox[\"\\\"CMYKColor[\\\"\", \"MR\"]\)\!\(\*StyleBox[\"\\\"c\\\"\", \"TI\"]\)\!\(\*StyleBox[\"\\\",\\\"\", \"MR\"]\) \!\(\*StyleBox[\"\\\"m\\\"\", \"TI\"]\)\!\(\*StyleBox[\"\\\",\\\"\", \"MR\"]\) \!\(\*StyleBox[\"\\\"y\\\"\", \"TI\"]\)\!\(\*StyleBox[\"\\\",\\\"\", \"MR\"]\) \!\(\*StyleBox[\"\\\"k\\\"\", \"TI\"]\)\!\(\*StyleBox[\"\\\"]\\\"\", \"MR\"]\) """颜色指定
"\!\(\*StyleBox[\"\\\"Dashing[\\\"\", \"MR\"]\)"{"\!\(\*StyleBox[\"\\\"w\\\"\", \"TI\"]\)"1"\!\(\*StyleBox[\"\\\",\\\"\", \"MR\"]\) ... "}"\!\(\*StyleBox[\"\\\"]\\\"\", \"MR\"]\) "线型指定
"\!\(\*StyleBox[\"\\\"EdgeForm[\\\"\", \"MR\"]\)\!\(\*StyleBox[\"\\\"spec\\\"\", \"TI\"]\)\!\(\*StyleBox[\"\\\"]\\\"\", \"MR\"]\) ""多边形边指定 "
"\!\(\*StyleBox[\"\\\"FaceForm[\\\"\", \"MR\"]\)\!\(\*StyleBox[\"\\\"spec\\\"\", \"TI\"]\)\!\(\*StyleBox[\"\\\"]\\\"\", \"MR\"]\) "多边形面指定
"\!\(\*StyleBox[\"\\\"GrayLevel[\\\"\", \"MR\"]\)\!\(\*StyleBox[\"\\\"i\\\"\", \"TI\"]\)\!\(\*StyleBox[\"\\\"]\\\"\", \"MR\"]\) ""灰度指定"
"\!\(\*StyleBox[\"\\\"Hue[\\\"\", \"MR\"]\)\!\(\*StyleBox[\"\\\"h\\\"\", \"TI\"]\)\!\(\*StyleBox[\"\\\"]\\\"\", \"MR\"]\) "色调指定
"\!\(\*StyleBox[\"\\\"PointSize[\\\"\", \"MR\"]\)\!\(\*StyleBox[\"\\\"d\\\"\", \"TI\"]\)\!\(\*StyleBox[\"\\\"]\\\"\", \"MR\"]\) "点尺寸指定
"\!\(\*StyleBox[\"\\\"RGBColor[\\\"\", \"MR\"]\)\!\(\*StyleBox[\"\\\"r\\\"\", \"TI\"]\)\!\(\*StyleBox[\"\\\",\\\"\", \"MR\"]\) \!\(\*StyleBox[\"\\\"g\\\"\", \"TI\"]\)\!\(\*StyleBox[\"\\\",\\\"\", \"MR\"]\) \!\(\*StyleBox[\"\\\"b\\\"\", \"TI\"]\)\!\(\*StyleBox[\"\\\"]\\\"\", \"MR\"]\) ""颜色指定"
"\!\(\*StyleBox[\"\\\"SurfaceColor[\\\"\", \"MR\"]\)\!\(\*StyleBox[\"\\\"spec\\\"\", \"TI\"]\)\!\(\*StyleBox[\"\\\"]\\\"\", \"MR\"]\) "表面属性指定
"\!\(\*StyleBox[\"\\\"Thickness[\\\"\", \"MR\"]\)\!\(\*StyleBox[\"\\\"w\\\"\", \"TI\"]\)\!\(\*StyleBox[\"\\\"]\\\"\", \"MR\"]\) "线宽指定
• 可以使用下列选项:
"\!\(\*StyleBox[\"\\\"AmbientLight\\\"\", \"MR\"]\) ""\!\(\*StyleBox[\"\\\"GrayLevel[0.]\\\"\", \"MR\"]\) """光照强度
"\!\(\*StyleBox[\"\\\"AspectRatio\\\"\", \"MR\"]\) ""\!\(\*StyleBox[\"\\\"Automatic\\\"\", \"MR\"]\) ""高与宽的比 "
"\!\(\*StyleBox[\"\\\"Axes\\\"\", \"MR\"]\) ""\!\(\*StyleBox[\"\\\"False\\\"\", \"MR\"]\) "是否画出坐标轴
"\!\(\*StyleBox[\"\\\"AxesEdge\\\"\", \"MR\"]\) ""\!\(\*StyleBox[\"\\\"Automatic\\\"\", \"MR\"]\) ""坐标轴放在哪条边上 "
"\!\(\*StyleBox[\"\\\"AxesLabel\\\"\", \"MR\"]\) ""\!\(\*StyleBox[\"\\\"None\\\"\", \"MR\"]\) ""坐标标签"
"\!\(\*StyleBox[\"\\\"AxesStyle\\\"\", \"MR\"]\) ""\!\(\*StyleBox[\"\\\"Automatic\\\"\", \"MR\"]\) ""用于指定坐标风格的图形指令 "
"\!\(\*StyleBox[\"\\\"Background\\\"\", \"MR\"]\) ""\!\(\*StyleBox[\"\\\"Automatic\\\"\", \"MR\"]\) ""图形的背景色 "
"\!\(\*StyleBox[\"\\\"Boxed\\\"\", \"MR\"]\) ""\!\(\*StyleBox[\"\\\"True\\\"\", \"MR\"]\) "是否画出有界盒框
"\!\(\*StyleBox[\"\\\"BoxRatios\\\"\", \"MR\"]\) ""\!\(\*StyleBox[\"\\\"Automatic\\\"\", \"MR\"]\) ""有界3D盒框比"
"\!\(\*StyleBox[\"\\\"BoxStyle\\\"\", \"MR\"]\) ""\!\(\*StyleBox[\"\\\"Automatic\\\"\", \"MR\"]\) ""用来指定盒框风格的图形指令"
"\!\(\*StyleBox[\"\\\"ColorOutput\\\"\", \"MR\"]\) ""\!\(\*StyleBox[\"\\\"Automatic\\\"\", \"MR\"]\) "输出颜色类型
"\!\(\*StyleBox[\"\\\"DefaultColor\\\"\", \"MR\"]\) ""\!\(\*StyleBox[\"\\\"Automatic\\\"\", \"MR\"]\) "图形元素的缺省颜色
"\!\(\*StyleBox[\"\\\"DisplayFunction\\\"\", \"MR\"]\) ""\!\(\*StyleBox[\"\\\"$DisplayFunction\\\"\", \"MR\"]\) """输出函数
"\!\(\*StyleBox[\"\\\"Epilog\\\"\", \"MR\"]\) ""\!\(\*StyleBox[\"\\\"{}\\\"\", \"MR\"]\) "主图之后使用的2D图形指令
"\!\(\*StyleBox[\"\\\"FaceGrids\\\"\", \"MR\"]\) ""\!\(\*StyleBox[\"\\\"None\\\"\", \"MR\"]\) "画在有界盒框的网格线
"\!\(\*StyleBox[\"\\\"FormatType\\\"\", \"MR\"]\) ""\!\(\*StyleBox[\"\\\"$FormatType\\\"\", \"MR\"]\) "文本的缺省格式类型
"\!\(\*StyleBox[\"\\\"ImageSize\\\"\", \"MR\"]\) ""\!\(\*StyleBox[\"\\\"Automatic\\\"\", \"MR\"]\) "笔记本中使用的图形的绝对大小
"\!\(\*StyleBox[\"\\\"Lighting\\\"\", \"MR\"]\) ""\!\(\*StyleBox[\"\\\"True\\\"\", \"MR\"]\) "是否使用模拟光照
"\!\(\*StyleBox[\"\\\"LightSources\\\"\", \"MR\"]\) ""(see below) ""光源的位置和颜色"
"\!\(\*StyleBox[\"\\\"PlotLabel\\\"\", \"MR\"]\) ""\!\(\*StyleBox[\"\\\"None\\\"\", \"MR\"]\) "图形的标签
"\!\(\*StyleBox[\"\\\"PlotRange\\\"\", \"MR\"]\) ""\!\(\*StyleBox[\"\\\"Automatic\\\"\", \"MR\"]\) "所包含值的范围
"\!\(\*StyleBox[\"\\\"PlotRegion\\\"\", \"MR\"]\) ""\!\(\*StyleBox[\"\\\"Automatic\\\"\", \"MR\"]\) ""要被填充的最后显示区域"
"\!\(\*StyleBox[\"\\\"PolygonIntersections\\\"\", \"MR\"]\) ""\!\(\*StyleBox[\"\\\"True\\\"\", \"MR\"]\) "是否让交叉多边形不改变
"\!\(\*StyleBox[\"\\\"Prolog\\\"\", \"MR\"]\) ""\!\(\*StyleBox[\"\\\"{}\\\"\", \"MR\"]\) ""主图之前使用的"2D"图形指令 "
"\!\(\*StyleBox[\"\\\"RenderAll\\\"\", \"MR\"]\) ""\!\(\*StyleBox[\"\\\"True\\\"\", \"MR\"]\) "是否使用所有的多边形
"\!\(\*StyleBox[\"\\\"Shading\\\"\", \"MR\"]\) ""\!\(\*StyleBox[\"\\\"True\\\"\", \"MR\"]\) "是否使多边形渐变
"\!\(\*StyleBox[\"\\\"SphericalRegion\\\"\", \"MR\"]\) ""\!\(\*StyleBox[\"\\\"False\\\"\", \"MR\"]\) "是否让外接球外接最后的显示区域
"\!\(\*StyleBox[\"\\\"TextStyle\\\"\", \"MR\"]\) ""\!\(\*StyleBox[\"\\\"$TextStyle\\\"\", \"MR\"]\) ""文本的缺省风格"
"\!\(\*StyleBox[\"\\\"Ticks\\\"\", \"MR\"]\) ""\!\(\*StyleBox[\"\\\"Automatic\\\"\", \"MR\"]\) ""标记"
"\!\(\*StyleBox[\"\\\"ViewCenter\\\"\", \"MR\"]\) ""\!\(\*StyleBox[\"\\\"Automatic\\\"\", \"MR\"]\) "放在最后显示区域中心的点
"\!\(\*StyleBox[\"\\\"ViewPoint\\\"\", \"MR\"]\) ""\!\(\*StyleBox[\"\\\"{1.3,\\\"\", \"MR\"]\) \!\(\*StyleBox[\"\\\"-2.4,\\\"\", \"MR\"]\) \!\(\*StyleBox[\"\\\"2.}\\\"\", \"MR\"]\) "观测位置
"\!\(\*StyleBox[\"\\\"ViewVertical\\\"\", \"MR\"]\) ""\!\(\*StyleBox[\"\\\"{0,\\\"\", \"MR\"]\) \!\(\*StyleBox[\"\\\"0,\\\"\", \"MR\"]\) \!\(\*StyleBox[\"\\\"1}\\\"\", \"MR\"]\) "垂直方向
• 可以给出图形指令的嵌套列表. 诸如GrayLevel的指定实际上只保持到直至包含它们的列表末尾.
Graphics[ ... ]的标准输入形式是-Graphics-.InputForm输出指令的显式列表.
• 被使用的缺省光源是   1,0,1 , RGBColor[1,0,0] ,   1,1,1 , RGBColor[0,1,0] ,   0,1,1 , RGBColor[0,0,1]  .
Graphics3D[SurfaceGraphics[ ... ]] 可以被用来把一个 SurfaceGraphics 对象转化为 Graphics3D 表示.
Graphics[SurfaceGraphics[ ... ]]根据普通2D图形指令产生一个表示.
• 参见 Mathematica全书: 2.9.1节.
Further Examples

Beside using functions like Plot3D, you create three-dimensional graphics with graphics primitives. The command draws a random quadrilateral.

Evaluate the cell to see the graphic.

In[1]:=