Log in or register to post comments

Project a fixed plane behind my trackable

April 2, 2011 - 5:49am #1

Hi

I'm trying to write an app which allows the user to move a pencil-shaped object (the trackable object) toward and into a fixed position target - in this case it's a flat plane consisting of a bulls-eye target. (Analogous to threading a needle, or throwing a dart)

I've found information in other threads about creating a 2D plane, but they all involve augmenting the plane against the modelViewMatrix, which means that the plane moves along with the trackable.

What i'd like to do is to fix the position of the target in space, and have the user try to move the trackable toward (and be occluded by) the target plane once they successfully intersect, but can't seem to work it out.

Hoping someone will be able to help :)

Many thanks,
Xerxes

Re: Project a fixed plane behind my trackable

April 6, 2011 - 3:50am #3

Thanks for the follow-up, rob.

Actually what I ended up doing (perhaps not ideal) was to create a flat 2d plane as per some of the other threads on this forum, and hand-wrote the matrix to locate it about 200 units in front of the camera, and applied a texture just like I would for a trackable.

The target is only painted as long as the marker is in view, but that's not a huge problem.

Re: Project a fixed plane behind my trackable

April 4, 2011 - 1:45am #2

I think you would doe something like

glMatrixMode(GL_MODELVIEW);
glLoadMatrixf(customModelViewMatrix.data);

When doing transforms etc for the static bulls eye.

and

glMatrixMode(GL_MODELVIEW);
glLoadMatrixf(QCARSuppliedModelViewMatrix.data);

When doing transforms etc for the image target.

Log in or register to post comments