Thanks very much! I have solved this problem by using command replay. My virtual bender machine is driven by a series of commands. I record how many steps (store in TotalSteps) are done and when record is required, I repeat previous steps (TotalSteps-StepBackward) to make every machine part and pipe a certain position. This process is not shown to users, the see the last picture.
while(true)
{
DoStep();
TotalSteps++;
viewer.frame();
}

....Keyboard handler when 'b' is pressed, playback.


while(playbackEnd)
{
DoFromFirstStep();
for(int i=0;i<TotalSteps-StepBackward;i++)
{
   DoSteps();
}
viewer.frame();
}

This works well. But a problem is, when steps are huge, this playback will become very slow. This should be optimized in future.

Robert Osfield wrote:
Hi,

You can create an osg::AnimationPath to record the position of the camrea at each frame, then play this back either by setting the view matrix per frame from the values derived from the AnimationPath, or use the osgGA::AnimationPathManipulator for this purpose.

This will just record the camera path, not the rest of the actions in the scene, for the rest of the actions there is record nor mean or creating a record of what you do to the scene graph, you'll have to record this some how.

Robert.

On 5/8/07, *hesicong2006* <[EMAIL PROTECTED] <mailto:[EMAIL PROTECTED]>> wrote:

    My application is a tube bender simulation application. Now we have a
    feature which can record and playback the whole scene, like some car
    racing video games. I don't know if OSG have this features and don't
    know which directions I should follow, can someone give me a advice?
    Thanks very much!

    _______________________________________________
    osg-users mailing list
    [email protected] <mailto:[email protected]>
    http://openscenegraph.net/mailman/listinfo/osg-users
    http://www.openscenegraph.org/ <http://www.openscenegraph.org/>




_______________________________________________
osg-users mailing list
[email protected]
http://openscenegraph.net/mailman/listinfo/osg-users
http://www.openscenegraph.org/

Reply via email to