How to fill wing movement in 3d?

조회 수: 2 (최근 30일)
Ziv Kassner
Ziv Kassner 2019년 6월 16일
댓글: Ziv Kassner 2019년 6월 17일
Hi,
I have a n-by-3 matrix of flapping wing tip path and a stationary base point (zeros(3,n)) - attached as 'wingtip.m'.
I want to use the 'fill3' function but I don't really understand how to use it in here.
I wish to fill the path in which the wing passes threw time.
The BAD way I did it so far is:
figure; hold on;
for i = 1:length(AA) % This is how the matrix in 'wingtip.m' is called
wing(1,1:3) = AA(i,1:3);
wing(2,1:3) = [0 0 0];
plot3(wing(:,1),wing(:,2),wing(:,3),'b','linewidth',10);
end
  댓글 수: 6
KSSV
KSSV 2019년 6월 17일
What coodinates correspond to wing?
Ziv Kassner
Ziv Kassner 2019년 6월 17일
AA(:,1:3) are wing tip trajectory, AA(:,4:6) is wing base that is stationary.

댓글을 달려면 로그인하십시오.

채택된 답변

Ziv Kassner
Ziv Kassner 2019년 6월 17일
Just made it happen:
for i = 1:length(AA)-1
fill3([AA(i,1);AA(i,4);AA(i+1,1)],...
[AA(i,2);AA(i,5);AA(i+1,2)],...
[AA(i,3);AA(i,6);AA(i+1,3)],'r','edgecolor','none')
hold on;
end
axis equal; grid on;
Thank you
  댓글 수: 2
darova
darova 2019년 6월 17일
편집: darova 2019년 6월 17일
no need for loop
x = AA(:,1);
y = AA(:,2);
z = AA(:,3);
h = surf([x x*0]', [y y*0]', [z z*0]');
alpha(h,0.5)
set(h,'EdgeColor','none')
set(h,'FaceLighting','phong',...
'AmbientStrength',0.5)
light('Position',[1 0 0],'Style','infinite');
#EDITED
Ziv Kassner
Ziv Kassner 2019년 6월 17일
Even better,
Thanks,
Ziv

댓글을 달려면 로그인하십시오.

추가 답변 (1개)

KSSV
KSSV 2019년 6월 17일
This is what you are looking for?
load 'wingtip.mat'
t = AA(:,1:3) ;
wing = AA(:,4:6) ;
patch(t(:,1),t(:,2),t(:,3))

카테고리

Help CenterFile Exchange에서 Multibody Dynamics에 대해 자세히 알아보기

제품


릴리스

R2017a

Community Treasure Hunt

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

Start Hunting!

Translated by