hello EgonOlsen, I captured some picture for explain my issue, when car start move , speed from 0 to maxspeed, the camera first at front of car and becomes at behind of car . The road path is closed ( loop) , when car run at the startpoint again , the camera will at front of car again and at behind the car later. I use the code take from car example desktop, and change some values like this:
SimpleVector oldCamPos=camera.getPosition();
SimpleVector oldestCamPos=new SimpleVector(oldCamPos);
oldCamPos.scalarMul(9f);
SimpleVector carCenter=cube.getTransformedCenter();
SimpleVector camPos=new SimpleVector(carCenter);
SimpleVector zOffset=cube.getZAxis();
SimpleVector yOffset=new SimpleVector(0, -30, 0); //here changed
zOffset.scalarMul(-300f); //here changed
camPos.add(zOffset);
camPos.add(yOffset);
camPos.add(oldCamPos);
camPos.scalarMul(0.1f);
SimpleVector delta=camPos.calcSub(oldestCamPos);
float len=delta.length();
if (len!=0) {
world.checkCameraCollisionEllipsoid(delta.normalize(), new SimpleVector(10, 10, 10), len, 3);
}
camera.lookAt(cube.getTransformedCenter());
BTW, I move the car only by set it's position , Is there something wrong ? Thanks very much for your help
[attachment deleted by admin]