converting Matrix34F (trackable pose) to screen coordinates

November 7, 2012 - 4:19pm #1

Could someone help to convert trackable pose to iPhone screen co-ordinates (CGRect)

QCAR::Matrix34F pose = trackableResult->getPose();

I want to get the location of the target on the iPhone screen and use it for rendering.

converting Matrix34F (trackable pose) to screen coordinates

November 8, 2012 - 12:27pm #5

 

Here are instructions for scaling and positioning models.

https://ar.qualcomm.at/content/opengl-how-do-i-scale-andor-position-my-models

To draw a rectangle, you'll use GL_LINES on an array of points corresponding to the target's border. Try posting to the OpenGL forum for some advice on how to set that up.

converting Matrix34F (trackable pose) to screen coordinates

November 8, 2012 - 11:24am #4

Thanks for the replies. However I am new to OpenGL and did not fully understand the code snippet. Could you please share mechanism to draw a rectangle around the trackable target? Or drawing/moving the target in 3D to 2D screen?

converting Matrix34F (trackable pose) to screen coordinates

November 7, 2012 - 5:08pm #3

 

Here are instructions for projecting points from target to screen space for both Android and iOS..

https://ar.qualcomm.at/content/technical-how-can-i-project-target-point-screen

converting Matrix34F (trackable pose) to screen coordinates

November 7, 2012 - 4:39pm #2

The pose is simply a 3D transformation, it is not an object in its own right that has a "location".

It you're trying to map the coordinates of the target from 3D to 2D, you'd take the coordinates of each corner (or perhaps just the center) and simply transform them through both the pose and the projection matrices to convert them to screen coordinates.

Note that the resulting points will form a general quadrilateral, not a simple rectangle.

Log in or register to post comments