Log in or register to post comments

Allocating Textures based on Multi-target recognised

December 18, 2013 - 8:03pm #1

Hi,

Firstly apologies for the newbie question. Essentially my issue is quite basic, as mentioned numerous times in the forums, I like many others am attempting to replace texture of a rendered object based on the image recognised, however the majority of support I have found seems to not work for MutliTargets as im doing something wrong.

For the test I am using the BowlAndSpoonModel, I have created two .png files; one blue (as given in the sample) and red. Within the EagleView of multitargets I have imported the extra texture (giving me 1. cube 2. blue bowl 3. red bowl) within the render I have included this extra code:

        int targetIndex = 0;

        if (!strcmp(trackable.getName(), "box1"))  // name of Multi-Target 1 within dataset

            targetIndex = 1;

        else if (!strcmp(trackable.getName(), "box2")) // name of Multi-Target 2 within dataset

            targetIndex = 2;

        

        glActiveTexture(GL_TEXTURE0);

        //glBindTexture(GL_TEXTURE_2D, [augmentationTexture[0] textureID]);

        if (offTargetTrackingEnabled) {

            glBindTexture(GL_TEXTURE_2D, augmentationTexture[3].textureID);

        } else {

            glBindTexture(GL_TEXTURE_2D, augmentationTexture[targetIndex].textureID);

        }

 
I assumed this would be enough to alter textures based on multi-image found but instead am recieving the following error:
Use of undeclared identifer 'trackable'.

Any suggestions?
Also would this be enough in order to get what I want done? (i.e do i need to consider another class as well)

Thanks and apologies again for wasting your time for a probably simple mistake.

(P.S. Im using v2.8)

Allocating Textures based on Multi-target recognised

December 19, 2013 - 2:46pm #4

Apologies, silly mistake, all fixed.

Thanks

Allocating Textures based on Multi-target recognised

December 19, 2013 - 6:23am #3

You simply need to check your code and go through the debugger, to locate the problem and fix it.

N

Allocating Textures based on Multi-target recognised

December 18, 2013 - 8:41pm #2

Fixed the error earlier with this line:  const QCAR::Trackable& trackable = result->getTrackable(); 

I am now getting a thread error of exc_bad_access (code = 1) - My guess its a mistake with my assignment of targetIndex.

 

Log in or register to post comments