By denmasmr001
on Tue, 10/30/2012 - 07:44
Hai Guys, i have a problem here.
i have done some basic things here, like change the 3d model to another object instead of a teapot, and change the image target to another picture instead of stone and chips. what i want to do next is showing 2 different objects with 2 different image targets simmultaneously .
In the image target sample, we just can show a teapot with different texture in 2 different image targets (in stoneandchip dataset). Although, actually i know it is only one teapot object that have 2 textures. the point is how can i show 2 different object instead of one objects that have two textures.
Showing 2 Object Models with 2 Different Image Targets
Hi, if you look at the _renderFrame function in ImageTargets.cpp, you'll see that for each Trackable detected in the State object
a teapot is rendered (see code from setting the modelview matrix using getPose() and down to glDrawElements() call);
Showing 2 Object Models with 2 Different Image Targets
Alessandro, did you mean this codes?
Showing 2 Object Models with 2 Different Image Targets
Hi, indeed the to pieces of code are connected, basically the connection is represented by the modelViewMatrix, in which you set the Pose of the target; the modelViewMatrix is then used below to position the target in 3D space using OpenGL.
Showing 2 Object Models with 2 Different Image Targets
oh, so that is the purpose of the loop.. it is handling one trackable for each iteration of the loop, isn't it? and the point the loop know how many our trackable is by this condition:
Showing 2 Object Models with 2 Different Image Targets
at each iteration, the trackable is set to the following:
QCAR::Trackable *trackable = state.getActiveTrackable( tIdx );