Hi,
your code only renders 8 frames, so you probably just miss the first 7.
try something like:
while (1) {
pos+=10;
if (pos>80) pos=0;
...
}
to make an endless loop and you should then see stuff move.
jp
Ash Pat wrote:
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
--
This message is subject to the CSIR's copyright terms and conditions, e-mail legal notice, and implemented Open Document Format (ODF) standard.
The full disclaimer details can be found at http://www.csir.co.za/disclaimer.html.
This message has been scanned for viruses and dangerous content by MailScanner,
and is believed to be clean. MailScanner thanks Transtec Computers for their support.
_______________________________________________
osg-users mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org