当前位置: 首页>>代码示例>>C++>>正文


C++ TriMesh::appendPosition方法代码示例

本文整理汇总了C++中TriMesh::appendPosition方法的典型用法代码示例。如果您正苦于以下问题:C++ TriMesh::appendPosition方法的具体用法?C++ TriMesh::appendPosition怎么用?C++ TriMesh::appendPosition使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在TriMesh的用法示例。


在下文中一共展示了TriMesh::appendPosition方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: getMesh

TriMesh ciFaceTracker::getMesh(const vector<vec3>& points) const {
    TriMesh mesh;
    if (!mIsFailed) {
        int n = size();
        for (int i = 0; i < n; i++) {
            mesh.appendPosition(points[i]);
            mesh.appendTexCoord({ getImagePoint(i).x / mImgSize.x, getImagePoint(i).y / mImgSize.y });
        }
        addTriangleIndices(mesh);
    }
    return mesh;
}
开发者ID:KeeganRen,项目名称:FaceVFX,代码行数:12,代码来源:ciFaceTracker.cpp

示例2: trackerThreadFn

void FaceOff::trackerThreadFn()
{
    jing::Option option;
    option.scale = 0.5f;
    mOfflineTracker = jing::BaseFaceTracker::create();
    mOnlineTracker = jing::BaseFaceTracker::create(option);

    bool shouldInitFaceMesh = false;

    while (!mShouldQuit)
    {
        // TODO: more robust with update_signal
        if (!mCapture.checkNewFrame())
        {
            sleep(1.0f);
            continue;
        }
        
        if (mDoesCaptureNeedsInit)
        {
            // TODO: more robust with setup_signal
            mDoesCaptureNeedsInit = false;

            CAM_W = mCapture.size.x;
            CAM_H = mCapture.size.y;

            auto createFboFn = [this]
            {
                gl::Fbo::Format fboFormat;
                fboFormat.enableDepthBuffer(false);
                mRenderedOfflineFaceFbo = gl::Fbo::create(CAM_W, CAM_H, fboFormat);
                mFaceMaskFbo = gl::Fbo::create(CAM_W, CAM_H, fboFormat);

                mClone.setup(CAM_W, CAM_H);
                mClone.setStrength(16);
            };
            dispatchAsync(createFboFn);
        }

        if (mPeopleId != PEOPLE_ID)
        {
            mPeopleId = PEOPLE_ID;

            ImageSourceRef img = loadImage(loadAsset("people/" + mPeopleNames[PEOPLE_ID]));
            updateOfflineImage(img);

            shouldInitFaceMesh = true;
        }

        mOnlineTracker->update(mCapture.surface);

        if (!mOnlineTracker->getFound())
        {
            mHasNewRenderedFace = false;
            continue;
        }

        int nPoints = mOnlineTracker->size();
        if (shouldInitFaceMesh)
        {
            shouldInitFaceMesh = false;
            mFaceMesh.getBufferTexCoords0().clear();

            auto imgSize = mOfflineTracker->getImageSize();
            for (int i = 0; i < nPoints; i++)
            {
                vec3 point = mOfflineTracker->getImagePoint(i);
                mFaceMesh.appendTexCoord({ point.x / imgSize.x, point.y / imgSize.y });
            }
            mOnlineTracker->addTriangleIndices(mFaceMesh);
        }

        mFaceMesh.getBufferPositions().clear();
        for (int i = 0; i < nPoints; i++)
        {
            mFaceMesh.appendPosition(mOnlineTracker->getImagePoint(i));
        }

        if (VFX_VISIBLE && mOfflineFaceTex)
        {
            dispatchAsync(bind(&FaceOff::updateClone, this));
        }
    }
}
开发者ID:OpenAVR,项目名称:FaceVFX,代码行数:84,代码来源:FaceVFXApp.cpp


注:本文中的TriMesh::appendPosition方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。