如何计算预测的3D网格在MATLAB网格、MATLAB

2023-09-08 10:45:57 作者:迟早

我试图来计算使用MATLAB不同意见的3D网格的2D投影。 我米用现在的解决办法,是绘制三维网格,旋转,并进行了截图。

I'm trying to compute 2d 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.

我想知道是否有任何MATLAB内部函数或任何其他的解决方案,让我,给定一组顶点和三角形的,计算的预测,而无需绘制三维网格

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

感谢

推荐答案

您可以使用的 视图 命令,旋转轴和改变观点。方位角和仰角以度给出(参见更多信息文档)。这里有一个小例子:

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])

这是什么样子的: