开发者

How to compute projections of 3D meshes in matlab

I'm trying to compute 2d 开发者_JAVA技巧projections of a 3d mesh from different views using matlab. The solution I m using now, is to plot the 3d mesh, rotate it, and make a screenshot.

I would like to know if there is any matlab internal functions or any other solution that allow me, given a set of vertices and triangles, to compute the projections without having to plot the 3D mesh

Thanks


You can use the view command to rotate the axes and change the viewpoint. The azimuth and elevation are given in degrees (ref. documentation for more info). Here's a small example:

ha=axes;
[x,y,z]=peaks;
surf(x,y,z);
xlabel('x');ylabel('y');zlabel('z')

%#projection on the X-Z plane
view(ha,[0,0])

%#projection on the Y-Z plane
view(ha,[90,0])

%#projection on the X-Y plane
view(ha,[0,90])

This is what it looks like:

How to compute projections of 3D meshes in matlab

Projections on different 2D planes

X-Z

How to compute projections of 3D meshes in matlab

Y-Z

How to compute projections of 3D meshes in matlab

X-Y

How to compute projections of 3D meshes in matlab

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜