Log in or register to post comments

UserDefindTargets + ImageTarget

October 17, 2013 - 10:49pm #1

Hi All,

Currently i have need in my project where i have to implement UserDefindTarget app with predefind image i.e ImageTarget example, how can i merge this two differnt codes to geather? i.e Overlaying on pre-defind image as well as user can capture its own target, Any help will be appreciated. Thanks in advance :)

--

Thanks 

Sonal.

UserDefindTargets + ImageTarget

October 24, 2013 - 11:49pm #7

Yes Nalin, i am using latest version of vuforia and using iPad 2 with ios 6 and ios 7 both. 

Now app is not crashing, i can see overlay on predefind image, but as soon as i capture another target it stops showing overlay on predefined image. My guess is, dataset is being getting flushed some where. 

UserDefindTargets + ImageTarget

October 21, 2013 - 2:51am #6

Are you using the latest version of Vuforia?

What model iPad & iOS is it?

N

UserDefindTargets + ImageTarget

October 20, 2013 - 9:31pm #5

Thanks for your input Nalin,  Still no luck, I tried your suggestion, but when i move the ipad around App crashes and this happens every time.

UserDefindTargets + ImageTarget

October 18, 2013 - 4:00am #4

I was able to get both working by adding the following in the UDT sample:

1 - Add this line in [application didFinishLaunchingWithOptions] to add the target 

 

    [qUtils addTargetName:@"Stones & Chips" atPath:@"StonesAndChips.xml"];

2 - Add StonesAndChips.dat & .xml files to Resources/Assets folder

3 - Add the following to initUserDefinedTargets in UDTQCARutils.mm

 

    BOOL haveLoadedOneDataSet = NO;

    // Load all the requested datasets

    for (DataSetItem *aDataSet in targetsList)

    {

        if (aDataSet.path != nil)

        {

            aDataSet.dataSet = [self loadDataSet:aDataSet.path];

            if (haveLoadedOneDataSet == NO)

            {

                if (aDataSet.dataSet != nil)

                {

                    // activate the first one in the list

                    [self activateDataSet:aDataSet.dataSet];

                    haveLoadedOneDataSet = YES;

                }

            }

        }

    }

    

    // Check that we've loaded at least one target

    if (!haveLoadedOneDataSet)

    {

        NSLog(@"QCARutils: Failed to load any target");

        appStatus = APPSTATUS_ERROR;

        errorCode = QCAR_ERRCODE_LOAD_TARGET;

    }

 

    

 

Build, and run, and it works :)

 

N

 

 

UserDefindTargets + ImageTarget

October 18, 2013 - 2:47am #3

Yes NalinSi began with UDT and trying to implement ImageTarget into it. But the problem is, at time only one of them is working, i implemented Following functions in AppDelegate class.

 

 

 

 

1.(void)[UDTQCARutils getInstance];

 

2.ImageTargetsQCARutils *qUtils1 = [ImageTargetsQCARutils getInstance];

[qUtils1 addTargetName:@"Chips" atPath:@"Chips.xml"];

 

 

 

Here overlay for predefind image(ImageTarget) is not working but UDT does work, when i comment out 1. line of code then UDT stops working and  ImageTarget works. Any suggestions?

 

 

UserDefindTargets + ImageTarget

October 18, 2013 - 1:55am #2

how can i merge this two differnt codes to geather?

By analysing functionality specific to each and then wiring together.

My suggestion would be to start with UDT and add IT after i.e. add the simple one to the more complex one.

 

Log in or register to post comments