Author Topic: Integrating JPCT-AE with wikitude native android API  (Read 438 times)

Offline angieIe

  • byte
  • *
  • Posts: 29
    • View Profile
Integrating JPCT-AE with wikitude native android API
« on: April 05, 2016, 08:39:52 am »
Hi everyone,

I am trying integrate jpct ae with wikitude AR. I already look at the tutorial integrate artoolkit with jpct ae as reference. But i have problem that object 3D not stay in marker.  Here is my code so far:
Code: [Select]
  public void onDrawFrame(GL10 gl) {
               if (_wikitudeRenderExtension != null) {
                _wikitudeRenderExtension.onDrawFrame(gl);
                }

              if (_currentlyRecognizedTarget != null) {
                world.removeAllObjects();

                float[] projectionCamera = _currentlyRecognizedTarget.getProjectionMatrix();
                projMatrix.setIdentity();
                projMatrix.setDump(projectionCamera);
                projMatrix.transformToGL();
                SimpleVector translation=projMatrix.getTranslation();
                SimpleVector dir=projMatrix.getZAxis();
                SimpleVector up = projMatrix.getXAxis();
                cam.setPosition(translation);
                cam.setOrientation(dir, up);


                markerMatrix.setIdentity();
                float[] marker1Transformation= _currentlyRecognizedTarget.getViewMatrix();
                markerMatrix.setDump(marker1Transformation);
                markerMatrix.transformToGL();
                cube.clearTranslation();
                cube.setRotationMatrix(markerMatrix);
                cube.setTranslationMatrix(markerMatrix);
               // cam.setBack(markerMatrix);
                world.addObject(cube);
                world.renderScene(fb);
                world.draw(fb);
                fb.display();

Please kindly assist. Thank you :)

Offline EgonOlsen

  • Administrator
  • quad
  • *****
  • Posts: 11777
    • View Profile
    • http://www.jpct.net
Re: Integrating JPCT-AE with wikitude native android API
« Reply #1 on: April 05, 2016, 04:06:10 pm »
What exactly does it do instead? Maybe it's a field of view related issue?