1

I am following a tutorial on the Metaio website - Creating a New AR Application, and it seems to work (I get the Metaio splash screen, and the watermark shows up on the camera view when I build and run it on an ipad.

I'm trying to get the Hello World tutorial to work, using code directly copied from the Metaio SDK, but I am not able to get the model to appear over the racking image.

The implementation file code is below - I am getting no errors when I run it on an ipad, and get the camera view etc, but no 3d model - any suggestions? Thx:

   #import "ViewController.h"
@interface ViewController ()
@end

@implementation ViewController
- (void) viewDidLoad
{
    [super viewDidLoad];
    // load our tracking configuration
    NSString* trackingDataFile = [[NSBundle mainBundle] pathForResource:@"TrackingData_MarkerlessFast"
                                                                 ofType:@"xml"
                                                            inDirectory:@"Assets"];

    if(trackingDataFile)
    {
        bool success = m_metaioSDK->setTrackingConfiguration([trackingDataFile UTF8String]);
        if( !success)
            NSLog(@"No success loading the tracking configuration");
            }

    // load content
    NSString* metaioManModel = [[NSBundle mainBundle] pathForResource:@"metaioman"
                                                               ofType:@"md2"
                                                          inDirectory:@"Assets"];

    if(metaioManModel)
    {
        metaio::IGeometry* theLoadedModel =  m_metaioSDK->createGeometry([metaioManModel UTF8String]);
        if( theLoadedModel )
        {
            // scale it a bit up
            theLoadedModel->setScale(metaio::Vector3d(1.0,1.0,1.0));
        }
        else
        {
            NSLog(@"error, could not load %@", metaioManModel);
        }
    }
}
@end
Knickers
  • 11
  • 3

1 Answers1

0

Did you also use the xml tracking file, that should be in the assets folder? As I see it, it could come from several errors:
- The tracking image doesn't have the same name in the xml file and in your folders
- the tracking file is empty or contains errors


Maybe you could share the xml tracking file as well so we could help you more.

Good luck

Tony Malt
  • 1
  • 1