【问题标题】:Translate a GeometryGroup in OptiX在 OptiX 中转换几何组
【发布时间】:2012-12-03 03:10:27
【问题描述】:

我正在使用 NVIDIA 的 OptiX 光线追踪引擎。

我想知道如何在渲染期间转换 GeometryGroup(或其实例)的位置。

从示例中,我看到了如何翻译整个场景(使用中间按钮)。但我想翻译单个模型/几何组。

【问题讨论】:

    标签: nvidia raytracing


    【解决方案1】:

    我最终完成了这段代码,它翻译了第一个几何模型:

    void updateObjectPos(float dX, float dY, float dZ)
    {
        // we have only one group - the main group whose childs are instances of Transform
        // mainGroup is an instance of Group
        Transform t = mainGroup->getChild<Transform>(0);
        float m[16];
        t->getMatrix(false, m, NULL);
        m[3] += dX;
        m[7] += dY;
        m[11]+= dZ;
        t->setMatrix(false, m, NULL);
    
        // mark dirty so that the acceleration structure gets rebuilt
        mainGroup->getAcceleration()->markDirty();
    }
    

    【讨论】:

    • 您使用的是哪个 optix 版本?我用 optix 3.8 试过这个,但没有用。你知道如何使用新的 optix 转换对象吗?
    • @mmostajab 对不起,我没有。如果我没记错的话,这是 OptiX 2.x
    猜你喜欢
    • 1970-01-01
    • 2021-06-15
    • 2021-12-21
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2016-05-23
    • 1970-01-01
    相关资源
    最近更新 更多