Log in or register to post comments

Replacing target shape with 2D Image

July 24, 2017 - 10:02pm #1

It has been achieved to replace the teapot with 2D image, but if I want to track the co ordinates of the target shape, what should I use?

If I use this code below from "How To Draw a 2D Image on top of a Target using OpenGL ES" 



Vuforia::Vec2F targetSize = ((Vuforia::ImageTarget *) trackable)->getSize();



It causes error in Android Studio saying "Image Target is abstract function"



What to do now to get the target coordinates and? 

Replacing target shape with 2D Image

July 27, 2017 - 3:02pm #2

i don't understand what you mean but maybe you look at the VuMark Samples?

for the size something like this

TrackableResult result = state.getTrackableResult(tIdx);
ImageTargetResult imageTargetResult = (ImageTargetResult) result;
ImageTarget imgTgt = (ImageTarget) imageTargetResult.getTrackable();
float imgWidth = imgTgt.getSize().getData()[0];
float imgHeight = imgTgt.getSize().getData()[1];
Matrix.scaleM(modelViewMatrix......

Coordinates you can get from the result.getPose() Matrix

Log in or register to post comments