【问题标题】:Converting 3D coordinates to 2D in 3ds max在 3ds max 中将 3D 坐标转换为 2D
【发布时间】:2015-03-21 23:40:37
【问题描述】:

考虑到视口的宽度和高度,我正在尝试将平面对象中点的 3D 坐标转换为 2D 坐标。 我正在用 C++ 编写代码。

在浏览 3Ds max 文档时,我发现了函数“MapViewToScreen”, 这个功能够用吗?如果是这样如何实现它。 如果还有其他方法也请建议。

【问题讨论】:

    标签: c++ 3dsmax


    【解决方案1】:

    查看链接map-world-point-to-viewport-coordinates

    基本上你需要做的是

    //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);
    

    【讨论】:

      猜你喜欢
      • 2018-05-25
      • 2014-06-12
      • 1970-01-01
      • 2015-01-01
      • 2015-06-29
      • 2012-03-06
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多