Re: [osg-users] moving a vehicle at constant velocity

2009-01-27 Thread Jean-Sébastien Guay
Hi Alfonso, I'm afraid I already have the KB896256 patch installed because I have Windows XP sp3. I will try to update the nvidia drivers to see if the timer problems are solved. Hmmm, it was just a guess anyways. I have never really seen timer inaccuracies of the order you describe... I'm a

Re: [osg-users] moving a vehicle at constant velocity

2009-01-27 Thread Alfonso Callejo Goena
Jean-Sebastien, Robert and all, I'm afraid I already have the KB896256 patch installed because I have Windows XP sp3. I will try to update the nvidia drivers to see if the timer problems are solved. Thank you, Alfonso ___ osg-users mailing list osg-user

Re: [osg-users] moving a vehicle at constant velocity

2009-01-27 Thread Alfonso Callejo Goena
Jean-Sebastien, Robert and all, I'm afraid I already have the KB896256 patch installed because I have Windows XP sp3. I will try to update the nvidia drivers to see if the timer problems are solved. Thank you, Alfonso ___ osg-users mailing list osg-user

Re: [osg-users] moving a vehicle at constant velocity

2009-01-26 Thread Jean-Sébastien Guay
Hi Robert, Alfonso, I still find it curious that your timer is so erratic, the problems that you are having certainly aren't something that lots of people have problems with, yet the task of moving objects around is very common indeed. One thing to check, on Windows XP systems with dual-core p

Re: [osg-users] moving a vehicle at constant velocity

2009-01-26 Thread Robert Osfield
Hi Alfonso, I still find it curious that your timer is so erratic, the problems that you are having certainly aren't something that lots of people have problems with, yet the task of moving objects around is very common indeed. Robert. On Mon, Jan 26, 2009 at 11:02 AM, Alfonso Callejo Goena wro

Re: [osg-users] moving a vehicle at constant velocity

2009-01-26 Thread Alfonso Callejo Goena
Hi Robert: I have two ways of performing the displacement: -- time = nv->getFrameStamp()->getSimulationTime(); mT.makeTranslate( vehSpeed*time, 0., 0. ); -- mT.makeTranslate( dist, 0., 0. ); dist=dist+avgTime*vehSpeed; // avgTime is the average time per callback In the first case jumps ap

Re: [osg-users] moving a vehicle at constant velocity

2009-01-23 Thread Robert Osfield
Hi Alfonso, Is it possible to disable the second core? It'd be interesting to see if this affects the quality of the results from the timer. Also are you running your app with vsync enabled? Robert. On Thu, Jan 22, 2009 at 9:22 AM, Alfonso Callejo Goena wrote: > I'm using a Core 2 Duo 1.8 GHz

Re: [osg-users] moving a vehicle at constant velocity

2009-01-22 Thread Alfonso Callejo Goena
I'm using a Core 2 Duo 1.8 GHz 3 GB and a GeForce 8600 512 MB. I have seen that some jumps come when the time between callbacks is between the average 0.016 s and 0.040 s, and others with a delta time higher than 0.040 s. I can understand the latter jumps, but not the former... I will try what Jim

Re: [osg-users] moving a vehicle at constant velocity

2009-01-21 Thread Robert Osfield
HI Alfonso, What hardware/OS platform are you working on? I'm wondering if the timer code is not producing consistent results, as even if frame rate changes that speed that an object moves should be related to the time delta between frames. Robert. On Wed, Jan 21, 2009 at 4:30 PM, Alfonso Calle

Re: [osg-users] moving a vehicle at constant velocity

2009-01-21 Thread Alfonso Callejo Goena
I have disabled the "threaded optimization" of my nvidia GPU and the simulation runs significantly smoother. However, if the vehicle's speed is high, the jumps reappear. I have also examined the osggeometry example, as Paul suggested, and the effect is also present, though not so clear (this could

Re: [osg-users] moving a vehicle at constant velocity

2009-01-21 Thread Jim Brooks
>I am trying to move a vehicle on scene by means of an update callback. It >should be a realistic simulation, and I want the vehicle to move, for >instance, at a constant velocity of 5 m/s. >The callback function I have written has the following aspect: If the frame-rate surges/stalls often, you

Re: [osg-users] moving a vehicle at constant velocity

2009-01-21 Thread Paul Melis
Alfonso Callejo Goena wrote: I have changed the line double t = osg::Timer::instance()->time_m()/1000; by double t = nv->getFrameStamp()->getSimulationTime(); and the rough behaviour persists. In fact they are almost the same... How does the osggeometry example run for you? Does it show t

Re: [osg-users] moving a vehicle at constant velocity

2009-01-21 Thread Alfonso Callejo Goena
I have changed the line double t = osg::Timer::instance()->time_m()/1000; by double t = nv->getFrameStamp()->getSimulationTime(); and the rough behaviour persists. In fact they are almost the same... Using osgSim would help me in such a simple case? Thanks, Alfonso

Re: [osg-users] moving a vehicle at constant velocity

2009-01-21 Thread Robert Osfield
Hi Alfonso, Use the osg::FrameStamp object that used by the OSG to record the time of a frame, this object is maintained by the Viewer, and is passed into the callback via the NodeVisitor. So do: nv->getFrameStamp()->getSimulationTime(); Robert. On Wed, Jan 21, 2009 at 9:52 AM, Alfonso Calle

Re: [osg-users] moving a vehicle at constant velocity

2009-01-21 Thread Adrian Egli OpenSceneGraph (3D)
There is a simulation time in the osg core. i would use this time as base of a simulation. and my you should have a look at simulation libaray 2009/1/21 Alfonso Callejo Goena > Hello: > > I am trying to move a vehicle on scene by means of an update callback. It > should be a realistic simulatio

[osg-users] moving a vehicle at constant velocity

2009-01-21 Thread Alfonso Callejo Goena
Hello: I am trying to move a vehicle on scene by means of an update callback. It should be a realistic simulation, and I want the vehicle to move, for instance, at a constant velocity of 5 m/s. The callback function I have written has the following aspect: osg::Matrix mT, dmT; // global variable