By ArekZ
on Tue, 10/11/2016 - 17:25
Hi,
I just run sample from vuforia sample set and I modifed it for using jPCT library (*) So I have the code responsible for tracking (Look below). There is a TrackbleResult object which contains the pose. But pose is a matrix which consider move the device camera and move the tracked object. And I don't see any method to get only move the tracked object.
I want to interact with rendered 3d object by moving the tracked marker/image. Is there in API such method to do that (get how move the tracked object not device camera)?
private void renderFrame() { // clear color and depth buffer GLES20.glClear(GLES20.GL_COLOR_BUFFER_BIT | GLES20.GL_DEPTH_BUFFER_BIT); // get the state, and mark the beginning of a rendering section State state = mRenderer.begin(); // explicitly render the video background mRenderer.drawVideoBackground(); float[] modelviewArray = new float[16]; // did we find any trackables this frame? for (int tIdx = 0; tIdx < state.getNumTrackableResults(); tIdx++) { // get the trackable TrackableResult result = state.getTrackableResult(tIdx); Trackable trackable = result.getTrackable(); Matrix44F modelViewMatrix = Tool.convertPose2GLMatrix(result.getPose()); Matrix44F inverseMV = SampleMath.Matrix44FInverse(modelViewMatrix); Matrix44F invTranspMV = SampleMath.Matrix44FTranspose(inverseMV); modelviewArray = invTranspMV.getData(); updateModelviewMatrix(modelviewArray); } mRenderer.end(); }
* look here: https://github.com/TheMaggieSimpson/Vuforia559_jPCT-AE sample (but jPCT isn't important for this question).