Integrating JPCT-AE with wikitude native android API

Started by angieIe, April 05, 2016, 08:39:52 AM

Previous topic - Next topic

angieIe

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:

  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 :)

EgonOlsen

What exactly does it do instead? Maybe it's a field of view related issue?