Fixing the axes while animating in matlab (not all

2019-09-03 07:26发布

I am trying to animate a cube (i wish there was a function for cube along the lines of cylinder() ) moving in 3d space. It has both rotation and translation. While I succeeded in animating, the axes seems to be scaling dynamically. I would like them to stop. I want to fix the axis limits. i want the axis to be constant from the beginning to the end.

I am new to animating. I got a piece of code from the internet that demonstrates animating demo prog : http://pastebin.com/fbv9gDS2

I edited that so that I can animate a cube. but then i ended up with an animation where the axis was continuously changing.

edited prog: http://pastebin.com/k3cEm4Fq

PS: the links are safe, no spam

1条回答
贪生不怕死
2楼-- · 2019-09-03 08:04

You can fix the axes by using the axis command with specific limits. For example

axis( [-2 2 -3 3 -4 4] );

sets the axes limits for 'x' in the range -2,2, for 'y' in the range -3,3 and for 'z' in the range -4,4.

查看更多
登录 后发表回答