Hi i'm making some App with QCAR & JPCT-AE. can SOMEONE see my source code & advice me? if you can, i'll send my source code to you. my email address is [email protected].
Please help me ^^
first
- i send modelViewMatrix(QCAR::Matrix44F) from JNI to JAVA ex) JNIEXPORT jfloatArray JNICALL Java_jp_may_com_VirtualButtonsRenderer_getNowMatrix(JNIEnv* env, jobject obj)
- use this modelViewMatrix like below
public class VirtualButtonsRenderer implements GLSurfaceView.Renderer {
public VirtualButtonsRenderer(Activity act) {
Config.maxAnimationSubSequences = 999;
// TODO Auto-generated constructor stub
this.act = act;
_Object3D = Loader.loadMD2(act.getResources().openRawResource(R.raw.tris), 1.0f);
_Object3D.setName("MyTarget");
}
public native float[] getNowMatrix();
public void onSurfaceCreated(GL10 gl, EGLConfig config) {
initRendering();
QCAR.onSurfaceCreated();
world = new World();
world.setAmbientLight(20, 20, 20);
TextureManager tm = TextureManager.getInstance();
com.threed.jpct.Texture Cover = new com.threed.jpct.Texture(BitmapFactory.decodeStream(act.getResources().openRawResource(R.raw.skin)));
tm.addTexture("Cover", Cover);
_Object3D.setTexture("Cover");
world.addObject(_Object3D);
world.buildAllObjects();
sun = new Light(world);
sun.setIntensity(250, 250, 250);
Camera cam = world.getCamera();
cam.moveCamera(Camera.CAMERA_MOVEOUT, 100);
cam.lookAt(_Object3D.getTransformedCenter());
SimpleVector sv = new SimpleVector();
sv.set(_Object3D.getTransformedCenter());
sv.x -= 300;
sv.z -= 0;
sun.setPosition(sv);
MemoryHelper.compact();
}
public void onDrawFrame(GL10 gl) {
if (!mIsActive)
return;
if (renderFrame()) {
Matrix NowMatrix = new Matrix();
NowMatrix.fillDump(getNowMatrix());
world.getCamera().setBack(NowMatrix);
world.renderScene(fb);
world.draw(fb);
fb.display();
return;
} else {
mIsTouch = false;
}
}
}
here, i got problem. i thought Object3D can move like Teapot(QCAR Sample Object) on Marker with modelViewMatrix. but it couldn't.
this is my problem ^^;;