tak*_*toa 10 wolfram-mathematica
我正在使用Mathematica 8,我正在努力进行纹理化.尽管多面体对象的纹理已被证明相对简单,但我在尝试纹理球体时遇到了问题.在文档中,纹理显示的球体的唯一方法是使用SphericalPlot3D
,恕我直言,这是一个kludgey解决方案,特别是因为我正在尝试在球体上执行操作(例如:翻译).在toto,我的问题是:有没有办法纹理一个球体原语?
Hei*_*ike 11
你不能Sphere
直接纹理a ,但你可以使用eg创建纹理球体SphericalPlot3D
并提取第一部分以获得可以操作的基元Translate
.例如
sphere = SphericalPlot3D[1, th, phi, Mesh -> False, PlotPoints -> 25,
PlotStyle -> {Opacity[1], Texture[ExampleData[{"ColorTexture", "GiraffeFur"}]]},
TextureCoordinateFunction -> ({#4, #5} &)][[1]];
Graphics3D[Translate[sphere, {{0, 0, 0}, {2, 2, 2}}]]
Run Code Online (Sandbox Code Playgroud)
这样的东西会有所帮助:
sphere = SphericalPlot3D[1, {u, 0, Pi}, {v, 0, 2 Pi},
TextureCoordinateFunction -> ({2 #5, 1 - 2 #4} &),
PlotStyle -> { Lighting -> "Neutral", Axes -> False,
Boxed -> False, Texture[texture]}, Mesh -> None][[1]];
F[k_] := Graphics3D[ Rotate[ sphere, k, {2, 1, 6}, {0, 0, 0}], Boxed -> False]
Run Code Online (Sandbox Code Playgroud)
现在,我们可以为旋转的纹理球体设置动画(围绕{2, 1, 6}
锚点处的矢量{0,0,0}
):
Animate[F[k], {k, 0, 2 Pi}]
Run Code Online (Sandbox Code Playgroud)
归档时间: |
|
查看次数: |
1810 次 |
最近记录: |