Qia*_* Li 4 wolfram-mathematica
如果给定一个标准化的旋转轴,例如{1/Sqrt [3],1/Sqrt [3],1/Sqrt [3]}和3d图,例如,
z[x_, y_] := Exp[-(Sqrt[x^2 + y^2]/Power[4, (3)^-1]) +
Power[4, (3)^-1]*Sqrt[1/2*(Sqrt[x^2 + y^2] + x)]];
Plot3D[2*z[x, y], {x, -5, 5}, {y, -5, 5}]
我想为这个关于轴{1/Sqrt [3],1/Sqrt [3],1/Sqrt [3]}(可能是任何其他任意一个)的图创建一个动画,然后将其导出为动画GIF.有人请帮忙吗?非常感谢.
编辑
我还指出了旋转的一个自由度.任何人都可以帮助,如果还给出旋转轴必须通过的点的坐标,如何进行可视化/动画?再次感谢.
复制丹尼尔所做的,准备出口.
axis = {1, 1, 1};
l = {-7, 7};
s = Table[
Plot3D[2*z[x, y], {x, -5, 5}, {y, -5, 5}, PlotRange -> {l, l, l}] /.
gg : GraphicsComplex[___] :> Rotate[gg, theta, axis], {theta, 0., 2. Pi}];
Export["c:\\test.gif", s]
Run Code Online (Sandbox Code Playgroud)

以下参数可用于gif导出(根据文档):
"AnimationRepetitions" how many times the animation is played before stopping
"Background" background color shown in transparent image regions
"BitDepth" bits used to represent each color channel in the file
"ColorMap" color reduction palette, given as a list of color values
"GlobalColorMap" default color palette for individual animation frames
"DisplayDurations" display durations of animation frames, given in seconds
"ImageCount" number of frames in an animated GIF
"ImageSize" overall image size
"RawData" array of color map indices
"Comments" user comments stored in the file
Run Code Online (Sandbox Code Playgroud)
我过去使用过"DisplayDurations",它起作用了.
可以这样做.
axis = {1, 1, 1};
Animate[
Plot3D[2*z[x, y], {x, -5, 5}, {y, -5, 5}] /.
gg : GraphicsComplex[___] :> Rotate[gg, theta, axis],
{theta, 0., 2.*Pi}]
Run Code Online (Sandbox Code Playgroud)

Daniel Lichtblau Wolfram Research
| 归档时间: |
|
| 查看次数: |
6113 次 |
| 最近记录: |