如何在 matlab 中计算 3D 网格的投影 [英] How to compute projections of 3D meshes in matlab
问题描述
我正在尝试使用 matlab 从不同视图计算 3d 网格的 2d 投影.我现在使用的解决方案是绘制 3d 网格,旋转它并制作屏幕截图.
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 内部函数或任何其他解决方案允许我在给定一组顶点和三角形的情况下计算投影而无需绘制 3D 网格
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
谢谢
推荐答案
您可以使用 view
命令旋转轴和改变视点.方位角和仰角以度数给出(更多信息请参考文档).这是一个小例子:
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])
这是它的样子:
这篇关于如何在 matlab 中计算 3D 网格的投影的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!