手抄报 安全手抄报 手抄报内容 手抄报图片 英语手抄报 清明节手抄报 节约用水手抄报

用Mathematica让3D图形动起来

时间:2024-10-11 18:49:19

1、 画一个单位正方体,再让它绕z轴旋转,代码如下:Animate[Graphics3D[Rotate[Cuboid[], n Degree, {0, 0, 1}]], {n, 0, 360,1}]

用Mathematica让3D图形动起来

2、 让各面半透明化,可以更好地观察整个图形:Animate[Graphics3D[{Opacity[.5], Rotate[Cuboid[], n Degree, {0, 0, 1}]}, Boxed -> False], {n, 0, 360, 1}]

用Mathematica让3D图形动起来

3、 再画一个稍微复杂的图形:Animate[Graphics3D职邗珩垃[{PointSize[0.03], Opacity[.5], Rotate[{EdgeForm[Blue], Po造婷用痃lyhedronData["TruncatedDodecahedron", "Faces"], Style[Point[ PolyhedronData["TruncatedDodecahedron", "VertexCoordinates"]], Opacity[1], Red]}, n Degree, {0, 0, 1}, {0.5, 0.5, 0}]}, Boxed -> False], {n, 0, 360, 1}]

用Mathematica让3D图形动起来

4、 Mathematica还能旋转文本:Animate[Rotate[Style[Sqrt[b^2 - 4 a c], Bold, Red, 30], n Degree], {n, 0, 360, 1}]

用Mathematica让3D图形动起来
© 手抄报圈