"We offer new support options and therefor the forums are now in read-only mode! Please check out our Support Center for more information." - Vuforia Engine Team

Understanding getPose function

Hi all, I'm very new to Android and to QCAR, so please bare with me. I'm trying to display 2D image on the tracked image. I can get the screenPoint and display image on the screen by using [CODE]QCAR::Vec2F screenPoint = QCAR::Tool::projectPoint(cameraCalibration, trackable->getPose(), QCAR::Vec3F(0, 0, 0));[/CODE] I need also to scale & rotate the 2D image, so I think getPose function on trackable object can be the solution. Can someone explain the values in 3*4 matrix that getPose function returns? Are they x, y, z, u, v etc? Thanks in advance Oz

The pose is a 3D orientation matrix, analogous to the modelview matrix in OpenGL. It is used alongside the projection matrix to bring 3D world coordinates to screen coordinates.

I'm still trying to figure out how to get the center of each trackable for comparison purposes and to draw lines between each. I want to apply a tour algorithm to it. Edit: I found the solution by another thread Kim answered.

Hi Kim, Your answer is very helpful for me, newbie to openGL. I still have a question, if i dont like to use texture, i want to draw with the defined color, how can i do that ?

glColor3f is only available in OpenGL ES 1.x. You can switch the application to compile against the 1.1 libraries by setting the USE_OPENGL_ES_1_1 flag in Android.mk to true. The ImageTargets sample includes rendering code for both the 1.1 and 2.0 versions of OpenGL. - Kim

It still raise an same error after i set USE_OPENGL_ES_1_1 := true and move glColor3f into the code use for drawing in opengl 1.1 Here is the code, can you take a look : [CODE]#ifdef USE_OPENGL_ES_1_1 // Load projection matrix: glMatrixMode(GL_PROJECTION); glLoadMatrixf(pr

hi kim, I want to show 3d object model size such that it will cover entire target marker, for that i need widht and height of marker, I found this code snippet for getting size QCAR::Vec2F targetSize = ((QCAR::ImageTarget *) trackable)->getSize() but it is not compiling , it is showing error that

If you look through the renderFrame method you should find a chunk of code that looks like this: [CODE] QCAR::Matrix44F modelViewProjection; SampleUtils::translatePoseMatrix(0.0f, 0.0f, kObjectScale, &modelViewMatrix.data[0]); SampleUtils::scalePoseMatrix(kObjectSc

lhslktg (not verified)

Wed, 01/25/2012 - 22:25

[QUOTE=ksiva]If you look through the renderFrame method you should find a chunk of code that looks like this: [CODE] QCAR::Matrix44F modelViewProjection; SampleUtils::translatePoseMatrix(0.0f, 0.0f, kObjectScale, &modelViewMatrix.data[0]); SampleUtils::scalePoseMat

[QUOTE] And even I use same dimensional, it also show whole black. [/QUOTE] That was going to be my first guess... Make sure the images are 1024x1024 or smaller, and it's safest to use power-of-two dimensions (e.g. 128, 256, 512, 1024). Maybe the images were saved with a strange color profile?

lhslktg (not verified)

Thu, 01/26/2012 - 06:44

[QUOTE=ksiva]That was going to be my first guess... Make sure the images are 1024x1024 or smaller, and it's safest to use power-of-two dimensions (e.g. 128, 256, 512, 1024). Maybe the images were saved with a strange color profile?

Many devices do not support non-power-of-two (NPOT) textures. This is a hardware limitation. You can stretch your image to a power-of-two (POT) and then render it on a plane of the correct dimensions.

lhslktg (not verified)

Fri, 01/27/2012 - 23:23

[QUOTE=ksiva]Many devices do not support non-power-of-two (NPOT) textures. This is a hardware limitation. You can stretch your image to a power-of-two (POT) and then render it on a plane of the correct dimensions.

@ ozayolkan, Omen_20, tsengvn, gilesian, and lhslktg. Guys, why don't you use the Unity3d game engine for all of this? It is really easy to use, QCAR integrates very nicely with it, and it will save you a lot of time.