Question

I have a small problem with VRToolkit, an iPhone port of ARToolKitPlus. I don't need the 3D stuff of the framework but only the information of the detected marker. Everything works fine so far and I'm stuck with the marker vertex coordinates which are generated in real time on every frame.

I want to visualize the detected marker by drawing a simple CGRect around the edges of it. I'm getting the marker vertices in the 'TrackerSingleMarkerImpl.cxx' and I'm mainly using some sort of this code:

vertexArray[0] = marker_info[k].vertex[0][0];
vertexArray[1] = marker_info[k].vertex[0][1];
vertexArray[2] = marker_info[k].vertex[1][0];
vertexArray[3] = marker_info[k].vertex[1][1];
vertexArray[4] = marker_info[k].vertex[2][0];
vertexArray[5] = marker_info[k].vertex[2][1];
vertexArray[6] = marker_info[k].vertex[3][0];
vertexArray[7] = marker_info[k].vertex[3][1];

The CGRect is drawn successfully but the problem is that it's mirrored completely. So the horizontal and vertical axis are mirrored - when I swap X and Y, only the vertical axis remains mirrored which looks something like this:

http://i1218.photobucket.com/albums/dd416/vyrb1/artoolkit_marker_failure.png

Do you have any idea what could be the problem here? I don't need an exact question but a rough direction of where the problem could be. I tried to adjust files like 'arGetTransMat.cxx' but I'm not sure if the problem lies in the generated vertex coordinates - the projection of 3D models on the marker works perfectly well but this is in 3D space. I'm not using the projection matrix used in OpenGL ES (EAGLView) because I only need 2D and CGRect.

I hope you can help. Thanks in advance.

No correct solution

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top