Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- az = -60;
- el = 30;
- xyz = [.3 .4 .7] ;
- vert = [0 0 0;1 0 0;1 1 0;0 1 0;0 0 1;1 0 1;1 1 1;0 1 1];
- xyzProj = kron(ones(7,1),xyz) .* vert(2:end,:) ;
- vert = [vert; xyzProj] ;
- close
- subplot(1,3,1)
- fac = [1 2 3 4;1 2 6 5;1 4 8 5];
- patch('Vertices',vert,'Faces',fac,...
- 'FaceVertexCData',vert,'FaceColor','interp')
- view(az, el); axis vis3d
- set(gca, 'xdir', 'reverse'); set(gca, 'ydir', 'reverse')
- subplot(1,3,2)
- fac = [5 6 7 8;2 3 7 6;3 4 8 7];
- patch('Vertices',vert,'Faces',fac,...
- 'FaceVertexCData',vert,'FaceColor','interp')
- view(az, el); axis vis3d
- set(gca, 'xdir', 'reverse'); set(gca, 'ydir', 'reverse')
- subplot(1,3,3)
- fac = [1 2 3 4;1 2 6 5;1 4 8 5];
- patch('Vertices',vert,'Faces',fac,...
- 'FaceVertexCData',vert,'FaceColor','interp')
- fac = 7+[5 6 7 8;2 3 7 6;3 4 8 7];
- patch('Vertices',vert,'Faces',fac,...
- 'FaceVertexCData',vert,'FaceColor','interp')
- view(az, el); axis vis3d
- set(gca, 'xdir', 'reverse'); set(gca, 'ydir', 'reverse')
Advertisement
Add Comment
Please, Sign In to add comment