matlab - Draw a truncated rectangular pyramid -


how can draw truncated rectangular pyramid in matlab ? base , top rectangles should have 4:3 aspect ratio. enter image description here image shown guideline. ability through funnel nice.

>> x = [0 0 0 0; 1 1 -1 1; 1 -1 -1 -1]; y = [0 0 0 0; 5 5 5 5; 5 5 5 5];  z = [0 0 0 0; 1 1 -1 -1; -1 1 1 -1]; fill3(x,y,z, ones(3,4))  

this achieves pyramid enter image description here

now need adjustments cut peak.

x =[ 3/4 -3/4 -3/4 -3/4; 3/4 3/4 -3/4  3/4; 3 3 -3  3;  3 -3 -3 -3]; y =[ 5/2  5/2  5/2  5/2; 5/2 5/2  5/2  5/2; 5 5  5  5;  5  5  5  5];  z =[-4/2  4/2  4/2 -4/2; 4/2 4/2 -4/2 -4/2; 4 4 -4 -4; -4  4  4 -4]; fill3(x,y,z, ones(4,4))  grid 

this create truncated square pyramid 4:3 aspect ratio @ base.

enter image description here


Comments

Popular posts from this blog

css - SVG using textPath a symbol not rendering in Firefox -

Java 8 + Maven Javadoc plugin: Error fetching URL -

datatable - Matlab struct computations -