- 作者:xiaoxiao
- 发表时间:2020-12-23 10:59
- 来源:未知
FROM:
http://www.rit.edu/~pnveme/pigf/ThreeDGraphics/thrd_index.html
不同形状的矩形
The rectangle is a graphic object that is very useful to represent simple animation through simple graphics. A moving rectangle and text is shown in the following code. Simple animation like these are only restricted by your imagination
此主题相关图片如下:
% 3D Graphics - Graphic Object - rectangle % Dr. P.Venkataramanformat compact set(gcf,'Menubar','none','Name','Different Types of Rectangles', ... 'NumberTitle','off','Position',[10,600,400,300]); axis([0 8 0 6]); t = 0:0.1:1; for i = 1:10 if i > 1 delete(h1); end left = 2*t(i); bot = exp(0.5*t(i)); wid = 3*sin(t(i))+ 1; ht = 3*(t(i)*t(i)+0.1); col = rand(1,3); ecolor = rand(1,3); h = rectangle('Position',[left bot wid ht], ... 'FaceColor',col, ... 'EdgeColor',ecolor, ... 'LineWidth',1, ...