funy scene drawing from 1.4 to 1.5 ( still a problem in 1.7

If you are a new Irrlicht Engine user, and have a newbie-question, this is the forum for you. You may also post general programming questions here.
Radikalizm
Posts: 1215
Joined: Tue Jan 09, 2007 7:03 pm
Location: Leuven, Belgium

Post by Radikalizm »

I'd set up a couple of breakpoints to check the validity of your values whenever such a glitch happens, because at first sight I can't see anything in this code which could lead to the problem you're having

I am curious about one thing tho
Why are you updating your camera movement in your register function? Why not write an animator to do this?
The register function is generally not meant to do these kind of updates, it should only register your node while your animator updates movement

I don't know if this could cause any actual problems, but I'd suggest you separate the movement code from the actual camera and put it into an animator (I think you could actually move a lot of code away from this into an animator so you could just apply this to any ordinary camera)
ulao
Posts: 274
Joined: Fri Mar 28, 2008 2:13 am

Post by ulao »

During development I couldn't not get the animator function to run. I could try it again and re-track why, but no one was able to figure it out. I'll see if a few brake points shows a problem, and see what lines does it, but my guess is I wont see the glitch till the irrlicht update. Maybe there will be a clue left before hand but that is a lot of stuff to look at. Never the less I'll try it.
Last edited by ulao on Sun Jan 16, 2011 12:35 am, edited 2 times in total.
Radikalizm
Posts: 1215
Joined: Tue Jan 09, 2007 7:03 pm
Location: Leuven, Belgium

Post by Radikalizm »

ulao wrote:During development I couldn't not get the animator function to run. I could try it again and re-track why, but no one was able to figure it out. I'll see if a few brake points shows a problem, and see what lines does it, but my guess is I wont see the glitch till the irrlicht update. Maybe there will be a clue left before hand but that is a lot of stuff to look at. Never the less I'll try it.
That's another good reason for writing an animator

And debugging is the biggest (and most frustrating) part of software development, I've had my share of stuff to look at too in the past ^^
ulao
Posts: 274
Joined: Fri Mar 28, 2008 2:13 am

Post by ulao »

Well my intention was to get the animator to work, but just could not.
And debugging is the biggest (and most frustrating) part of software development, I've had my share of stuff to look at too in the past ^^
At least its possible, debugging JS is a real pain in the ars


From debugging here are my Findings: ( I'll just update this from time to time, if anything jumps out at anyone please post your thoughts )
-Put a break points in the OnRegisterSceneNodefunction
Each frame seems to draw a section of the world from one side to the other.
Here is a screen shot.
Image
-Tracked it down to the line causing the issue but nothing out of the ordinary.

Code: Select all

//vector3df vTemp = m_RealCamera->getRotation();// get current rotation
m_RealCamera->setTarget( vInTarget ); //set target for temp data
//vector3df vTarget = m_RealCamera->getRotation();// get destination rotation
m_RealCamera->setRotation( vTemp ); // put it back
If I dont run the setRotation line, I'm ok ( free from flicker ). So confusing...

Insolently this alone cause the issue. m_RealCamera->setRotation( m_RealCamera->getRotation() ); Inside or outside the OnRegisterSceneNode function. So its something to do with just calling that function. Even more interesting its only rotation , setting the position does not effect it.
Last edited by ulao on Sun Jan 16, 2011 4:58 am, edited 2 times in total.
Mikhail9
Posts: 54
Joined: Mon Jun 29, 2009 8:41 am

Post by Mikhail9 »

Whenever I am manipulating cameras, using camera positions, or anything of the sort, and strange things happen like flickering, jumping, shaking, generic weirdness... the first thing I try is calling UpdateAbsolutePosition() on the camera before doing anything to or with it.

Often it fixes the problem, usually for no obvious reason.

If you are desperate, you might give it a shot.
ulao
Posts: 274
Joined: Fri Mar 28, 2008 2:13 am

Post by ulao »

Thx for the suggestion, this also works and better then my fix. Seems to slow things down a bit, but I can live with that. I wonder what going on here?
Post Reply