Hi,

I'm trying to simulate a rigid body motion (translation and rotation) based on 
some Physics. Basically I have a number of bodies and a solve returns new 
positions for these bodies. I'd like to update the MatrixTransform associated 
with the bodies' nodes for each step which I'm hoping will show the motion.

Here's a snippet of a very simple example I tried.
pXform is a MatrixTransform 
pViewer is derived from osgViewer::Viewer and QGLWidget


Code:

for (int pos = 0; pos < 80; pos+=10)
{
    mat.set( 1, 0, 0, 0,
                 0, 1, 0, 0,
                 0, 0, 1, 0,
                 0, pos, 0, 1);
    pXform->setMatrix(mat);
    pViewer->frame();
}



I'm seeing only the final position. How do I force the render for each step? I 
thought the frame() method would do it but it's not happening.

Any suggestions would be much appreciated.

Thanks!

Regards,
Ash.

PS: By the way, I used the [code] tag for the code snippet. Why are there weird 
'?' like characters where I had spaces?

------------------
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=18905#18905





_______________________________________________
osg-users mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

Reply via email to