Flicking 3d landscape...what am I doing wrong?

Started by Darkflame, August 30, 2010, 10:47:44 PM

Previous topic - Next topic

Darkflame

While working on my AR application I noticed the landscape often "flicked" at first I thought this was a sensor issue, but dismissed that after I found the problem is still there even with a completely static set of co-ordinates.
Heres a video of the problem;

http://www.youtube.com/watch?v=dphRVM4HXaM

Essentially every time the sensors update now, this code runs;


Camera worldcam = world.getCamera();

worldcam.getBack().setIdentity();

float Z = xyzAngles.z;
float Y = xyzAngles.y;
float X = xyzAngles.x;

//worldcam.rotateCameraAxis(new SimpleVector(0,1,0), -Z);
//worldcam.rotateCameraAxis(new SimpleVector(1,0,0), X);
//worldcam.rotateCameraAxis(new SimpleVector(0,0,1), -Y);

worldcam.rotateCameraAxis(new SimpleVector(0,1,0), -0.081920266f);
worldcam.rotateCameraAxis(new SimpleVector(1,0,0), 0.5303804f);
worldcam.rotateCameraAxis(new SimpleVector(0,0,1), 0.84379244f);



Any idea's what cause's the graphical glitch?

EgonOlsen

Most likely a threading issue. Rendering and manipulation of the camera are most likely taking place in different threads, which isn't a good idea. Either synchronize this part with the rendering or (and better) just let the sensor update set some flags and do the actual operations based on this flags in the rendering thread.

Darkflame

ok, I'll try putting all my camera manipulations into "public void onDrawFrame(GL10 gl) {..." and see if that helps.

Darkflame