[Ves] Directly manipulating Projection Matrix and Model View

Cameron Lowell Palmer cameron.palmer at ntnu.no
Thu Jan 29 05:15:12 EST 2015


A-ha! You must use vesUniform not vesProjectionUniform. The projection uniform is more than a nicety, it handles update by replacing the matrix with the desired matrix with the one in render state. Would be nice to know how to just change the render state. So if someone knows, please chime in.


On 29. jan. 2015, at 05.59, Cameron Lowell Palmer <cameron.palmer at ntnu.no<mailto:cameron.palmer at ntnu.no>> wrote:

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/ca8fd01c/attachment.html>


More information about the Ves mailing list