Log in or register to post comments

How to export target coordinates to java?

May 30, 2011 - 9:16am #1

Hi,

I think I understood (more or less) how the pose matrix is used to render a 3D model with OpenGL. But I need to write a code that returns the coordinates of an object to the java class, i.e.:

the object is a MultiTarget; i would like to return (x,y) of a point on the MultiTarget to the Android application, which draws a circle on the screen (in (x,y)).

How can I do this?

Have you got any reference on Pose Matrix?

Thanks.

How to export target coordinates to java?

February 11, 2013 - 9:11am #5

Hi, if you are using Vuforia 2.0, this is the correct code to retrieve the camera calibrarion:

 

const QCAR::CameraCalibration& cameraCalibration =  
    QCAR::CameraDevice::getInstance().getCameraCalibration();

 

 
 

How to export target coordinates to java?

February 11, 2013 - 7:16am #4

I was using this code for a year now, and it appears the functions have changed. There is no getCameraCalibration() for Tracker.

Do you know how to get the camera calibration ?

Re: How to export target coordinates to java?

June 13, 2011 - 9:00am #3

Thank you!

I tried it, and it works, although (0,0,0) doesn't seems to be exactly the center, but a point near the edge.

Do you know how could I get the coordinates of the vertices of the marker, in order to draw a frame in the java class? Or the dimension of the marker in the screen, instead?

Thank you.

Re: How to export target coordinates to java?

May 30, 2011 - 1:32pm #2

There is a projectPoint method in Tool.h that can take a point from 3D target space to 2D screen space.

const QCAR::Tracker& tracker = QCAR::Tracker::getInstance();
const QCAR::CameraCalibration& cameraCalibration = tracker.getCameraCalibration();
QCAR::Vec2F screenPoint = QCAR::Tool::projectPoint(cameraCalibration, trackable->getPose(), QCAR::Vec3F(0, 0, 0));
LOG("screen point: %f, %f", screenPoint.data[0], screenPoint.data[1]);

This should map the center of the trackable (0, 0, 0) to screen coordinates.

- Kim

Log in or register to post comments