Screen Flicker when looking due south
by Steve Lamperti · in Torque Game Engine · 08/15/2007 (5:36 pm) · 3 replies
I am seeing an interesting problem in my TGE project. When the camera is facing due south, I get a flicker where the screen momentarily redraws as if the camera was pointed off to the side. i.e. the window renders as if the camera was pointed another direction then due south. It only happens momentarily, so it often just looks like a flicker on the screen, but if you watch carefully you can see objects that should be behind you.
I think that this may be some kind of error in the code that calculates which direction the camera is pointing for the rendering code, but I have no idea how to even start debugging this.
If anyone has any suggestions as to where to set a breakpoint, or how to debug this problem, I would appreciate hearing them.
I think that this may be some kind of error in the code that calculates which direction the camera is pointing for the rendering code, but I have no idea how to even start debugging this.
If anyone has any suggestions as to where to set a breakpoint, or how to debug this problem, I would appreciate hearing them.
#2
i've never noticed that.
on a side note, to be slightly more robust you might consider changing those ifs to whiles.
12/19/2007 (3:11 pm)
Interesting.i've never noticed that.
on a side note, to be slightly more robust you might consider changing those ifs to whiles.
#3
12/19/2007 (3:43 pm)
I was trying to keep the changes to the code to a minimum. Just the fix. But you are quite right that whiles would probably be better.
Torque Owner Steve Lamperti
Imagine That!
the code that checks to see if the Yaw exceeds a full circle is before the code that adds the yaw value to the z.
This means that the new yaw value is added to the z rotation without checking to see if it went around a full circle.
Here's my fix. If anyone sees an issue with this let me know, but it fixes my flicker.
// JSL - V7.0.1 moved this yaw code before the interpolating the wrong way code, as it seems to make more sense. // This fix seems to have fixed the flicker when looking due south problem that I was seeing. Huzzah! mRot.z += move->yaw; //Prevent interpolating the wrong way round a circle. if(mRot.z > M_PI_F) mRot.z -= M_2PI_F; if(mRot.z < -M_PI_F) mRot.z += M_2PI_F;