数学建模社区-数学中国

标题: 求教动态函数三维图像的合成(大神进) [打印本页]

作者: Fsen09    时间: 2012-7-6 15:05
标题: 求教动态函数三维图像的合成(大神进)
效果大致就是一个大球自转然后一个小点绕大球公转,分别做出两个图像最后不知道怎么合成啊 T.T% e2 o5 l4 x! I7 h/ w; |# i1 ~
代码如下- G. }) a# ]' E# }3 F0 U' r
大球自转Animate[ParametricPlot3D[{5 Sin[a] Cos[b + t], 5 Sin[a] Sin[b + t],
: }1 E' c" w+ v8 |& b   5 Cos[a]}, {a, 0, 2 Pi}, {b, 0, 2 Pi}, Axes -> False, 9 w2 @, _* a, q. Z  x5 S2 k
  Boxed -> False, Mesh -> True, PlotPoints -> 50, ; Z9 V' q1 G2 l$ O
  Lighting -> True], {t, 0, Pi}]! ~0 ]: J8 w0 v+ z2 l3 T" @
小球公转Animate[Graphics3D[{PointSize[0.1], Point[{Cos[a], Sin[a], 0}]},
" x0 {6 Q. [$ l4 x4 A9 G& `  PlotRange -> {{-1, 1}, {-1, 1}, {-2, 2}}], {a, 0, 2 Pi}]! `7 F+ `' D8 a( D
只求效果 欢迎大神自己编写代码 本人新人勿喷
作者: sycxyc    时间: 2012-7-7 16:08
修改一下就行了1 ]6 ^8 X4 l, m9 A4 I8 k% K# }5 F
Animate[Show[{ParametricPlot3D[{5 Sin[a] Cos[b + t],5 Sin[a] Sin[b + t], 5 Cos[a]}, {a, 0, 2 Pi}, {b, 0, 2 Pi},Axes -> False, Boxed -> False,Mesh -> True, PlotPoints -> 50, Lighting -> Automatic, PlotRange -> {{-10, 10}, {-10, 10}, {-5, 5}}],Graphics3D[{PointSize[0.1], Point[{8 Cos[a], 8 Sin[a], 0}]},PlotRange -> {{-10, 10}, {-10, 10}, {-2, 2}}]}],{t, 0, Pi}, {a, 0, 2 Pi}]




欢迎光临 数学建模社区-数学中国 (http://www.madio.net/) Powered by Discuz! X2.5