Running the application outside of VS make the cam. flicker

solaris1912

14-03-2008 23:26:25

As the topic suggests, when I run my (race game) application inside Visual Studio in release/debug mode, everything is fine, my camera code cleanly follows the car. However, when I run the executable that VS2005 has just created, the camera follows the car with a lot of jitter.

What may be the source of such a behavior?

Any ideas will be welcome...

betajaen

14-03-2008 23:37:23

You've opened a massive can of worms here. Luis is going to barge in and talk like crazy and insist you use this and that.

But in short, you have to use a interpolation method.

solaris1912

14-03-2008 23:52:54

The camera is updated in every "Ogre::FrameListener::frameStarted" to make sure that the camera always has the same distance from the target object (the car). but what I see when I run the app directly from the exe file is the car rapidly moves forward and backward when I'm accelerating (the acceleration code is called in processUnbufferedInput).

If my camera approach has had a defect, I suppose I'd have seen it while running inside VisualStudio05. Everything is perfect inside VS

But in short, you have to use a interpolation method.

Shall I change my cam. code anyway?

solaris1912

18-03-2008 01:22:51

After long long long hours, I came up with this solution

http://www.ogre3d.org/phpBB2addons/viewtopic.php?t=5445

Hmmm... after looking in the NxOgre sources and trying to play around with Iteration parameters I ended up with a simple...


Code:
mScene = mWorld->createScene("Main", sceneMgr, "gravity: yes, floor: yes, time-step-method: fixed");

...

bool AppFrameListener::frameStarted(const FrameEvent& evt)
{

mScene->simulate(evt.timeSinceLastFrame);
mScene->render(evt.timeSinceLastFrame);
...



And everything seems to be okay now ... no matter if 312.23 or 60 or 40 something fps ... my test objects always end up with the same yaw after applying a torque to them ... and the jittering is gone.


Even if betajaen disliked the solution, that worked for me.

EDIT: I also set "FrameListener: false" in Worlds' constructor.

betajaen

18-03-2008 08:44:09

Actually, I don't mind people doing that. If they did it the right way:

mWorld->getPhysXDriver()->simulate(evt.timeSinceLastFrame);
mWorld->getPhysXDriver()->render(evt.timeSinceLastFrame);

luis

18-03-2008 15:51:30

Hello people,
i´m on vacations right now (i´ll be back next month) in the mountains with a very slow connection and with no time to answer long posts, i´m very busy taking the sun and swiming in a river, sorry!

Betajaen is right you should use an interpolation method.
See this post:
http://www.ogre3d.org/phpBB2addons/view ... +jittering

I´m using that method in 1st and 3rd camera and i dont see any jittering.

Also check in the VS 2005 the ´current´ path you´re using when you run the app, perhaps in VS your game is loading a different DLL than when you run it ´directly´.