3D animation in MATLAB

Hello! I was given a task to animate the following figure:
u = 0:0.02:1;
v = 0:pi/25:2*pi;
[u,v] = meshgrid(u,v);
x = (2 + u.*cos(v)).*sin(2.*pi.*u);
y = (2 + u.*cos(v)).*cos(2.*pi.*u) + 2.*u;
z = u.*sin(v);
s = surf(x,y,z,'LineStyle','none');
set(s,'FaceColor','red','EdgeColor','none');
lighting phong;
camlight('headlight')
axis equal tight off;
As you can see, I've managed to plot it, but I have no idea, how to animate it! :(
Could you help me, please?

2 件のコメント

John
John 2015 年 3 月 18 日
What exactly would you like to animate? The code you have given us does not have a time component to it. If you do manipulate the function and want to make an animation based on what is displayed between updates to the framebuffer of the axes, then look up the getframe and movie commands.
Elias Gule
Elias Gule 2015 年 3 月 19 日
you can use hgtransform for that.

サインインしてコメントする。

回答 (1 件)

Mike Garrity
Mike Garrity 2015 年 3 月 19 日

2 投票

I've recently been writing about creating animations on our graphics blog . Perhaps some of those would be helpful. For example, this post or this post might give you some ideas.

1 件のコメント

Star Strider
Star Strider 2015 年 3 月 19 日
Those have to be some of the coolest graphics applications I’ve seen!

サインインしてコメントする。

カテゴリ

ヘルプ センター および File ExchangeAnimation についてさらに検索

製品

質問済み:

2015 年 3 月 18 日

コメント済み:

2015 年 3 月 19 日

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by