[Ves] Directly manipulating Projection Matrix and Model View

Cameron Lowell Palmer cameron.palmer at ntnu.no
Wed Jan 28 23:59:05 EST 2015


In order to achieve augmented reality in VES I’ve resorted to bypassing the vesCamera and updating the projection and model view of representations directly. I know this value has been updated based upon the subsequent variable, but nothing moves on screen.

When using a transform on an actor the calls all end in setBoundsDirty and the object moves. So what needs to change to achieve this result?


void vesKiwiCameraImagePlaneDataRepresentation::setProjectionMatrix(const vesMatrix4x4f &projectionMatrix)
{
    std::cout << std::endl << "Projection matrix" << std::endl << projectionMatrix << std::endl;

    this->_internal->_projectionMatrix->set(projectionMatrix);
}

void vesKiwiCameraImagePlaneDataRepresentation::setModelViewMatrix(const vesMatrix4x4f &modelViewMatrix)
{
//    std::cout << std::endl << "Model view matrix" << std::endl << modelViewMatrix << std::endl;
//
//    vesSharedPtr<vesUniform> currentModelViewMatrixUniform = this->_internal->_modelViewMatrix;
//    vesMatrix4x4f currentModelViewMatrix;
//    currentModelViewMatrixUniform->get(currentModelViewMatrix);
//    vesMatrix4x4f updatedModelViewMatrix;
//    updatedModelViewMatrix = modelViewMatrix * currentModelViewMatrix;
    this->_internal->_modelViewMatrix->set(modelViewMatrix);

    vesMatrix4x4f subsequent;
    this->_internal->_modelViewMatrix->get(subsequent);

    std::cout << std::endl << "Model view matrix" << std::endl << subsequent << std::endl;
}

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/ves/attachments/20150129/75adcbed/attachment-0001.html>


More information about the Ves mailing list