how to plot 3d pyramid ?
25 次查看(过去 30 天)
显示 更早的评论
Hi guys i got confused about ploting 3-D pyramid.
Here ara the edge coordinates of the pyramid.
pt1=[0 0 0]; pt2=[10 0 0]; pt3=[10 -10 0]; pt4=[0 -10 0]; pt5=[0 0 5];
How can i plot it with all of its surfaces ?
0 个评论
采纳的回答
Thorsten
2015-10-7
P = [pt1; pt2; pt3; pt4; pt5]
ind = [1 2 5]; patch(P(ind, 1), P(ind, 2), P(ind, 3), 'r')
hold on
ind = [2 3 5]; patch(P(ind, 1), P(ind, 2), P(ind, 3), 'r')
ind = [3 4 5]; patch(P(ind, 1), P(ind, 2), P(ind, 3), 'r')
ind = [4 1 5]; patch(P(ind, 1), P(ind, 2), P(ind, 3), 'r')
And for the base
ind = 1:4; patch(P(ind, 1), P(ind, 2), zeros(1,4), 'b')
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Geographic Plots 的更多信息
产品
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!