Hi Oliver,
You don't need to call update on a transform, as the value is computed
on each traversal. However, in you code I'd test to make sure that
the node is indeed a MatrixTransform, otherwise you'll be finding that
you applying operations to null.
Robert.
On 7/13/06, Oliver Kutter <[EMAIL PROTECTED]> wrote:
Hi,
I want to move one of my nodes before the rendering starts. So I get the
transformation matrix and do a translation like this:
Matrix newMatrix;
newMatrix.makeTranslate(5.0, 5.0, 5.0);
Matrix matrix =
myNode->asTransform()->asMatrixTransform()->getMatrix();
matrix.postMult(newMatrix);
myNode->asTransform()->asMatrixTransform()->setMatrix(matrix);
Afterwards I set the scene to the viewer and start the rendering:
viewer.setSceneData(group); // 'myNode' is one child of 'group'
viewer.realize();
while ( !viewer.done() ) {
viewer.sync();
viewer.update();
viewer.frame();
}
The translation is still set to that transformation matrix, but the result
is not visible on screen. Did I forget something? Do I have to update
anything else?
regards,
Oliver
_______________________________________________
osg-users mailing list
[email protected]
http://openscenegraph.net/mailman/listinfo/osg-users
http://www.openscenegraph.org/
_______________________________________________
osg-users mailing list
[email protected]
http://openscenegraph.net/mailman/listinfo/osg-users
http://www.openscenegraph.org/