Log in or register to post comments

Rendering when target not in view (UDT)

June 5, 2013 - 10:09pm #1

Hi, I would like to display my 2d texture when the target isn't in the view of the camera. This is in the UserDefinedTargets app. I just want it to display like it would on the very first frame when the program creates a new target and tracks it (perfectly parallel to the screen). The purpose is to let the user get a preview of what the projected texture is so he/she can align it before assigning it to a texture.


I have given some thought about doing this in the main thread, but I have a custon gui where I would be drawing to a view which isn't the same dimensions of the ar view. This would make it extremely difficult to calculate the initial position and size of the target in relation to the view.


Rendering when target not in view (UDT)

June 6, 2013 - 8:44am #4

Ok, thanks for the clarifications, now I understand better ;-)

Well, what you could do is to set your modelview matrix to identity when a target is not tracked;

if you look at the C++ code, in the renderFrame() method, you can see some code like this:

QCAR::Matrix44F modelViewMatrix =
So, you will need to set the modelViewMatrix to identify, and maybe add some scaling or custom translation on top of it..
You may find this small article useful too:

Rendering when target not in view (UDT)

June 6, 2013 - 6:24am #3

Well, imagine an app that utilizes the UDT sample and allows a user to augment a room in a house by placing 'virtual' furniture wherever he or she wants to.

The application would need to have the selected piece of furniture (couch, bed, television stand, etc) already displayed on screen so that the user can get an idea where it would be placed when the app actually starts to track. Or else, the person would have to constantly guess and check where the furniture would be rendered (because the objects might be tilted to a certain degree, or too far to the left, etc).


Essentially an object stops being rendered because the target is not in the view of the camera. I do not want the object to dissappear. Instead, I want it to stay visible and have its matrix reset.

Rendering when target not in view (UDT)

June 6, 2013 - 12:35am #2

Hi, not sure I fully understand what exactly you are trying to achieve, could you explain a bit more in detail ?


Log in or register to post comments