"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

Drawing Rectangle besides the marker and getting its coordinates to fill an image

Hi, i am newbie in QCAR. i am facing difficultly in getting area of a rectangle which i have drawn besides MARKER with the help of QCAR::Rectangle. I am getting coordinates for the rectangle using the following code. [CODE]const QCAR::Trackable* trackable = state.getActiveTrackable(i); QCAR::Matrix44F modelViewMatrix = QCAR::Tool::convertPose2GLMatrix(trackable->getPose()); //shani new const QCAR::ImageTarget* imageTarget = static_cast(trackable); QCAR::Vec2F::Vec2F screenPoint = imageTarget->getSize(); CGSize target; target.width = screenPoint.data[0]; target.height = screenPoint.data[1]; //NSLog(@"screen point: %f, %f", screenPoint.data[0], screenPoint.data[1]); CGRect rect = [self calcScreenCoordsOf:target inView:&modelViewMatrix.data[3] inPose:trackable->getPose()]; NSLog(@"%@",NSStringFromCGRect(rect)); [/CODE] It give me coordinates but these are either very near to the MARKER or completely out of range of marker showing just the corner of Marker. what i want is that i must get the Rectangle coordinates which i have just drawn so that i could use that to put an image there. This is besides MARKER not on the marker. Can someone help me out. ? Thanks

Take the image targets app and in EAGLView.mm using the following code at the top to define the plane:

blackswan007

Mon, 07/02/2012 - 08:40

Thanks for sharing code, How can i make the rectangle away from the marker and also will i be able to get the image of that specific area ?

blackswan007

Mon, 07/02/2012 - 11:47

hmmm okay many thanks. i am not actually openGL developer or know much of it. just had to drag myself for the company on this project.

 

anyways,

many many thanks for the time you took out for me.

Appreciated.

 

No problem blackswan007

Once you get the hang of it, OGLes can start to click quite quickly - just go a step at a time.

However if you do want to do anything quite fancy, it is welll worth looking at Unity as you can progress far more quickly in a short a space of time :)

N