HI, I do a simple test, the "walk step" is 1, when I click the screen ,the WayID ++, set camera position like this:
cam.setPosition(waypoint[WayID].calcAdd(waypoint[WayID+1].calcSub(waypoint[WayID])));
but the camera position still incrocrect, I don't know why?
I load 3d model like this:
try
{
obj = Loader.loadOBJ(res.getAssets().open("road.obj"),null,0.05f);
saidao =Object3D.mergeAll(Loader.loadOBJ(res.getAssets().open("road.obj"),null,0.05f));//
}
catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
Log.v("ttt", "load error!");
}
TextureManager.getInstance().addTexture("road", new Texture(res.openRawResource(R.raw.road)));
saidao.rotateX((float) (Math.PI) / 1f);
saidao.translate(0,10,0);
saidao.build();
world.addObject(saidao);
int k = 0;
for(int i = 0; i < obj.length; i++){
//world.addObject(obj);
if(obj.getName().contains("WP_")){
obj.build();
waypoint[k] = obj.getTransformedCenter();
wayNav[k] = obj;
k++;
Logger.log(obj.getTransformedCenter() + "-->GET WP->"+obj.getName());
}
else if(obj.getName().contains("Road"))
{
obj.setTexture("road");
}
}
the print is :
05-30 22:06:30.230: I/jPCT-AE(886): (-412.28714,1.8050749,1105.2081)-->GET WP->WP_1_jPCT1
05-30 22:06:30.230: I/jPCT-AE(886): Normal vectors calculated in 1ms!
05-30 22:06:30.230: I/jPCT-AE(886): (-482.62927,1.3220211,1107.2769)-->GET WP->WP_2_jPCT2
05-30 22:06:30.230: I/jPCT-AE(886): Normal vectors calculated in 1ms!
05-30 22:06:30.230: I/jPCT-AE(886): (-625.3562,1.3489301,1113.7605)-->GET WP->WP_3_jPCT3
.....................
Is there is something wrong ? thanks