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

Réponses (2)

Jonathan
Jonathan le 30 Jan 2011

0 votes

lol brah...
do you have any code to show that you've attempted it?

2 commentaires

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

Connectez-vous pour commenter.

Safwan Tanveer
Safwan Tanveer le 30 Jan 2011

0 votes

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.

Catégories

En savoir plus sur Verification, Validation, and Test dans Centre d'aide et File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by