"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

Showing 2 Object Models with 2 Different Image Targets

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.

AlessandroB

Tue, 10/30/2012 - 08:33

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);

AlessandroB

Wed, 10/31/2012 - 16:11

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.

 

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:

for(int tIdx = 0; tIdx < state.getNumActiveTrackables(); tIdx++)