Animation of a Door Opening and Closing

Could anyone please help me with the following animation? Thank you very much in advance.
I would like to make a three-dimensional animation of a door. Starting with the door closed at 0 deg and animating it opening to 90

回答(2 个)

Jonathan
Jonathan 2011-1-30
lol brah...
do you have any code to show that you've attempted it?

2 个评论

Wouldn't this reply be better as a comment on the question, rather than as an answer?
@David: Yes.

请先登录,再进行评论。

Safwan Tanveer
Safwan Tanveer 2011-1-30
N1=[1;0;0];N2=[0;1;0];N3=[0;0;1]; C1=[1;0;0];C2=[0;1;0];C3=[0;0;1]; p2=4;p3=10;
PNC=p2*C2+p3*C3; %Pnb=p2*N2 %Pnc=p2*N2+p3*N3 %Pnd=p3*N3;
%X1=[Pna(1) Pnb(1) Pnc(1) Pnd(1) Pna(1)]; %Z1=[Pna(2) Pnb(2) Pnc(2) Pnd(2) Pna(2)]; %Y1=[Pna(3) Pnb(3) Pnc(3) Pnd(3) Pna(3)]; %plot3(X1,Y1,Z1);
Pcc=0*C1+0*C2+0*C3; Pca=-p2*C2-p3*C3; Pcb=-p3*C3; Pcd=-p2*C2;
theta=(30*pi)/180; Rnc=[cos(theta),-sin(theta),0;sin(theta),cos(theta),0;0,0,1];
PNB=Rnc*(PNC+Pcb); PNA=Rnc*(PNC+Pca); PND=Rnc*(PNC+Pcd) ; Pnc=Rnc*PNC X=[PNA(1) PNB(1) PNC(1) PND(1) PNA(1)]; Y=[PNA(2) PNB(2) PNC(2) PND(2) PNA(2)]; Z=[PNA(3) PNB(3) PNC(3) PND(3) PNA(3)];
axis equal view([113.5,28]) plot3(X,Y,Z); grid on
I have tried with the above code. I have to run a 'for' loop for multiple trace of the door. But I couldn't position the door/figure as I wanted.

类别

帮助中心File Exchange 中查找有关 Animation 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by