Hi Robert,

Some explanation on what I want to do in my application.

First I need to shoot video from rendering at a specified frame rate (25FPS
for example).
So to do that I have a callback writting images on disk every frame, and I
have to slow down my rendering rate, and to increment my time from 1/25 of
sec.
After that I call advance with this new time (+1/25s).

But the main problem occurs when I want to play a path at this low rate, the
path manipulator is using real time reference to compute position and
orientation so when I shoot my video at 25FPS the path is accelerated.

I hope you understand what I need to do (my english vocabulary is limited
when it comes to technical explanation, sorry for that).

Unfortunately the only solution I had to solve my problem is to change
reference time with function "setReferenceTime" and give it my own time
computed on desired frame rate.

2009/6/17 Robert Osfield <[email protected]>

> Hi Alaxandre,
>
> You should leave the ReferenceTime alone, it's only SimulationTime
> that you should alter and calling frame or advance with this time is
> suffiicient - there is no need for the extra calls setting the time.
> The ReferenceTime is meant to be real-time value of the frames -
> something you'd use for doing stats collection etc., while
> SimulationTime is meant to be the time used when compute animations
> and physical simulations in the scene.
>
> The _startTick that the event queue uses should be the same one as the
> ReferenceTime uses and makes sure the ReferenceTime and event times
> are in sync.  It's not typically appropriate to use the SimulationTime
> when doing event handling, but if you want to then you'll need to use
> the frames FrameStamp to get the current SimulationTime.
>
> Robert.
>
> On Wed, Jun 17, 2009 at 10:23 AM, Alexandre
> Amalric<[email protected]> wrote:
> > Hi osg-users,
> >
> > I'm experiencing some problem with time management and osgViewer.
> >
> > I'm under Windows Vista, OSG SVN.
> >
> > I'm using a composite viewer and my rendering code is  :
> >
> > pCompoViewer->advance(MyTime);
> > pCompoViewer->getFrameStamp()->setReferenceTime(MyTime);
> > pCompoViewer->getFrameStamp()->setSimulationTime(MyTime);
> > pCompoViewer->eventTraversal();
> > pCompoViewer->updateTraversal();
> > pCompoViewer->renderingTraversals();
> >
> > instead of :
> >
> > pCompoViewer->frame()
> >
> > because I wand to trigger my rendering with a computed time 'MyTime"
> based
> > on a FPS I need.
> >
> > But my problem is that when I use my manipulator and ea.getTime() I do
> not
> > have the same time as "MyTime" when event received is for example
> > osgGA::GUIEventAdapter::PUSH.
> > ea.getTime() is equal to MyTime only when receiving
> > osgGA::GUIEventAdapter::FRAME.
> >
> > I tracked down this behaviour, in function
> > GraphicsWindowWin32::handleNativeWindowingEvent because event time is :
> >
> > double eventTime  = getEventQueue()->getTime();
> >
> > and getTime is returning :
> >
> > osg::Timer::instance()->delta_s(_startTick,
> osg::Timer::instance()->tick());
> >
> > That's why It doesnt match my rendering time...
> >
> > Is there any way I can resolve this problem ? (Except making my own
> > eventqueue class)
> >
> >
> > --
> > Alexandre AMALRIC                   Ingénieur R&D
> > ===================================
> > PIXXIM S.A. 73E, rue Perrin-Solliers 13006 Marseille
> > http://www.pixxim.fr
> >
> > _______________________________________________
> > osg-users mailing list
> > [email protected]
> >
> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
> >
> >
> _______________________________________________
> osg-users mailing list
> [email protected]
> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
>



-- 
Alexandre AMALRIC                   Ingénieur R&D
===================================
PIXXIM S.A. 73E, rue Perrin-Solliers 13006 Marseille
http://www.pixxim.fr
_______________________________________________
osg-users mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

Reply via email to