Thank you for your quick reply. Moving it after the build funktion crashed my program somehow, but now it's working with that implementation. But sadly it didn't solve my real problem.
I have an object standing on (0,0,0) and the camera moving freely. I track the position and the 3 directional Vectors of the pad and give it to the Activity to change the Camera in the world space. but now here's the problem. When the camera stands in front of the Object everythings fine. But when I move behind the object the object is linearly tilted till it reaches 45°. I have no clue, why. Some Numbers:
Object (0,0,0)
Camera Pos: (0,0,-2) Direction (0,0,1) Up (0,-1,0) // Everything is fine
Camera Pos: (0,0,2) Direction (0,0,-1) Up (0,-1,0) // The object is 45° tilted
When I stand at the side of the object it is slightly tilted.~22.5°
The Numbers I get from the tracker are all accurate. It seems like the worldspace is bent. Do you have any instant idea, what the matter is? Here is the onDrawFrame method:
public void onDrawFrame(GL10 gl) {
udp.needData=true;
Camera cam= world.getCamera();
SimpleVector[] sv=udp.getLast(); //Getting the camera tracking through a threaded udp Client
cam.setOrientation(sv[1], sv[2]);
cam.setPosition(sv[0]);
sun.setPosition(sv[0]);
fb.clear(back);
world.renderScene(fb);
world.draw(fb);
fb.display();
if (System.currentTimeMillis() - time >= 1000) {
Logger.log(fps + "fps");
fps = 0;
time = System.currentTimeMillis();
}
fps++;
}
I could make a workaround tilting the scene against the "natural" tilting. But I would like to know, why it is that way. If you need more code, just tell me. :-)
Thank you in advance,
Marc