Fixing the axes while animating in matlab (not allowing them to change)

不想你离开。 提交于 2019-12-11 18:45:58

问题


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:


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.



来源:https://stackoverflow.com/questions/23623483/fixing-the-axes-while-animating-in-matlab-not-allowing-them-to-change

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!