Game Development Community

Camera Jitters in Orbit mode

by Tim Hutcheson · in Torque Game Engine · 10/13/2005 (5:57 am) · 17 replies

I've been trying to track down why the camera view jitters when using the orbit mode. It looks like a transform is being taken in the renderImage thread, which would make it unsynched with the postioning thread occasionally, depending on load. But I tracked it down into ShapBase::renderImage(), etc., with no luck.

Anyone have any ideas about this? Very, very ugly effect with my vehicles that I would like to fix so their precise movements can be inspected.

#1
10/13/2005 (7:44 am)
Are you using the Advanced camera?
#2
10/13/2005 (7:51 am)
No, just using the latest CVS 1.4Rc2 code. The effect is very noticeable in orbit mode, especially if I orbit up under the vehicle where the view is close. But it's quite terrible even when watching the vehicle from a few meters.

The vehicle is rock solid when viewd in third person, BTW.
#3
10/13/2005 (8:00 am)
There's an orbit mode built into 1.4?
#4
10/13/2005 (8:06 am)
Yes, in onClientEnterGame()

%this.camera.setOrbitMode(%this.car, %this.car.getTransform(), 0.5, 4.5, 4.5);
#5
10/13/2005 (8:08 am)
Damn, if only i had a compiler besides tbe...
#6
10/13/2005 (9:10 am)
Are you using getTransform instead of getRenderTransform? this may cause jittering issues since the client updates from the server before updating the draw....check out the docs to see what they do if you are not familiar.
#7
10/13/2005 (9:15 am)
I'm using the release code without changes. I did track through the ShapeBase.renderImage code to look at the very issue you raised, but manipulating the points at which the transforms are taken didn't shed any light on the problem. The type of jitter I'm seeing seems consistent with the notion that the render transform is being taken in the render thread and is out of synch with the vehicle position by the time the render thread is executed. But only when the orbit mode is selected -- so I don't get that part yet.
#8
10/13/2005 (12:27 pm)
Something you may want to consider, too... the GetAnglesFromVector command only gives a rough estimate. It'll "pop." Here's a resource remedying that situation, but it is a little bit slower:

www.garagegames.com/index.php?sec=mg&mod=resource&page=view&qid=8618

I don't know if that would be the source of "jitters" or not, but it could be adding to the problem.
#9
10/13/2005 (5:32 pm)
The orbit camera is in 1.3 also it just wasn't used anywhere.
#10
10/13/2005 (8:01 pm)
Oh, well how would i go about implementing orbit mode in 1.3?
#11
10/13/2005 (8:15 pm)
You could try adding

%this.camera.setOrbitMode(%this.car, %this.car.getTransform(), 0.5, 4.5, 4.5);

at the end of GemeConnection:onClientEnterGame() in the game.cs file, where "car" might be player, etc., depending on circumstance.
#12
10/14/2005 (6:19 pm)
I have confirmed that this problem doesn't exist in the 1.3 released version or the LightingPack1.3.5 version. It only malfunctions in the 1.4Rc2 version.
#13
11/03/2005 (3:51 pm)
To contradict the last post - I'm running TGE+TLK1.3.5 with the Advanced Camera in orbit-cam mode and I AM getting a jitter.

It's funny that I didn't notice it for the first week, and now it really bugs me so i don't know if I didn't see it right away or if somthing else set it off. I tried undoing all the changes I made the day I first saw it ( all related to playerData) but nothing helped.

Has anyone found a solution to this?

[edit] The new angles/vectors code didn't help. The problem i'm noticing is best described as a 'pop' or 'jitter' in the cammera when i'm running. It seems the longer I run the more frequent it happens and the larger the 'offset' becomes.[/edit]
#14
11/03/2005 (4:11 pm)
Maybe we're talking about different levels of severity in the jitter. The amount of jitter I was talking about wouldn't have gone unnoticed and that is in 1.4RC2. In TGE and TLK1.3.5 in is there but miniscule (not perfect) by comparison.
#15
11/03/2005 (5:26 pm)
Ok, here it is, the world-premier first-ever in-game footage from my senior project, just for YOUR viewing pleasure!!! ( and i promise it's not "pre-rendered" :-P)

[url=http://stevengpeterson.com/dbin/public/video/demo000.rec]

Hope you enjoy, and hope it clairfies if we're seeing the same problem.

[edit] realized that .rec isn't what I thought. Tried using Frapps and GameCam but the problem goes away while recording. wierd...
#16
11/03/2005 (5:38 pm)
Http://www.garagegames.com/index.php?sec=mg&mod=resource&page=view&qid=8413

Do a find for "jitter" on this page. Is this us? I don't have time to check it out before I leave for the weekend. Might be worth a look-see though.
#17
11/30/2005 (5:48 pm)
What happened here? I think I might have come across a similar problem. In my game and in the starter.fps that comes with TGE1.4 when the player dies, the camera changes to orbit and jitters. Sometimes it even causes crashes.