according to the links supplied from you , i can inject the code of JPCT-AE into the ARToolkit's Project [ Example name : ARNative ].
JPCT-AE using the Matrix( "Projection Matrix" and "Transformation Matrix" ) which output from ARToolkit to render a model on the mark successfully. the center , scale of model can match the mark in every case ( as the attached shown ), but , the model alway lie in the mark. .
I have tried to use the Matrix.rotateX/Y/Z( float x ) to rotate the model but still no work .( the model still lie in the mark )
public void onDrawFrame(GL10 unused) {
float[] projection_temp = ARNativeActivity.getProjectM();
Matrix temp1 = new Matrix();
temp1.setDump(projection_temp);
[color=green]temp1.rotateY((float)Math.PI/2); // the rotate have to be used for diff. matrix [ "Projection Matrix" and "Transformation Matrix" ] as the same time , otherwise, the model will miss[/color]
float[] projection = temp1.getDump();
Matrix projMatrix = new Matrix();
projMatrix.setDump(projection);
projMatrix.transformToGL();
SimpleVector translation = projMatrix.getTranslation();
SimpleVector dir = projMatrix.getZAxis();
SimpleVector up = projMatrix.getYAxis();
cam.setPosition(translation);
cam.setOrientation(dir, up);
float[] transformation_temp = ARNativeActivity.getTransformationM();
Matrix temp2 = new Matrix();
temp2.setDump(transformation_temp);
[color=green]temp2.rotateY((float)Math.PI/2); // the rotate have to be used for diff. matrix [ "Projection Matrix" and "Transformation Matrix" ] as the same time , otherwise, the model will miss[/color]
float[] transformation = temp2.getDump();
Matrix dump = new Matrix();
dump.setDump(transformation);
dump.transformToGL();
alita.clearTranslation();
alita.translate(dump.getTranslation());
alita.setRotationMatrix(dump);
alita.setState(stat);
alita.animate(ticks);
world.renderScene(fb);
world.draw(fb);
fb.display();
}