我正在尝试考虑视口的宽度和高度将平面对象中点的3D坐标转换为2D坐标。我正在用C ++编写代码。
在浏览3Ds max文档时,我发现了函数“ MapViewToScreen”,这个函数足够吗?如果是这样,如何执行它。如果还有其他方法,请提出建议。
检查链接地图世界点到视口坐标
基本上,您需要做的是
//get Transfromation matrix of the plane
Matrix3 tmMatrix = inode->GetObjectTM( GetCOREInterface()->GetTime() );
ViewExp& vpt = GetCOREInterface()->GetActiveViewExp();
GraphicsWindow *gwindow= vpt.getGW();
gwindow->setTransform( Matrix3(1) );
//Your required point, consider only the X and Y part
IPoint3 out; // X and Y from the bottom left corner
Point3 in( your_3d_point * tmMatrix );
gwindow->hTransPoint(&in, &out);
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句