Technical - How should I define the sizes of my targets?

August 10, 2012 - 2:10pm #1
Sizing the trackables

The size of an ImageTarget is defined when the target is created in the TMS. This is the Width entered when creating a new target (the Height is automatically calculated from the aspect ratio of the image). The units correspond to OpenGL scene units and thus need to work with the perspective frustum set up by the projection matrix. For example, say you set up a projection matrix using the following code:

projectionMatrix = QCAR::Tool::getProjectionGL(cameraCalibration, 2.0f, 2000.0f);

Then you need to use a target size that would fall within the near plane at 2 and the far plane at 2000. A target of size 1 would be too small, and a target of size 2000 would be too big. A target with width 100 would be reasonable. Of course, you can always adjust the near and far planes as well. MultiTargets are also sized in the TMS. Markers are sized on creation (note frame markers are always square). If the application uses multiple trackables it may be important to size them relative to their real-world sizes. This is the case when multiple trackables will be tracked simultaneously. Say for instance you want to track a frame marker on top of an image target. If the printed frame marker is 1/4 the size of the printed image target, then the frame marker object should be created at 1/4 the size of the image target object. Otherwise, the 3D content sitting on the frame marker will not properly occlude the 3D content sitting on the image target.

Topic locked