Ios Metaio SDK-创建新的AR应用程序
我正在关注Metaio网站上的一个教程-创建一个新的AR应用程序,它似乎可以工作(我得到Metaio启动屏幕,当我在ipad上构建并运行它时,水印显示在相机视图上) 我试图使用直接从Metaio SDK复制的代码使Hello World教程正常工作,但我无法使模型显示在机架图像上 实现文件代码如下-当我在ipad上运行它时,我没有收到任何错误,并获得相机视图等,但没有3d模型-有任何建议吗?Thx:Ios Metaio SDK-创建新的AR应用程序,ios,xcode,sdk,metaio,Ios,Xcode,Sdk,Metaio,我正在关注Metaio网站上的一个教程-创建一个新的AR应用程序,它似乎可以工作(我得到Metaio启动屏幕,当我在ipad上构建并运行它时,水印显示在相机视图上) 我试图使用直接从Metaio SDK复制的代码使Hello World教程正常工作,但我无法使模型显示在机架图像上 实现文件代码如下-当我在ipad上运行它时,我没有收到任何错误,并获得相机视图等,但没有3d模型-有任何建议吗?Thx: #import "ViewController.h" @interface ViewCon
#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
您是否也使用了xml跟踪文件,该文件应位于assets文件夹中? 在我看来,它可能来自几个错误:
跟踪图像在xml文件和文件夹中的名称不相同
跟踪文件为空或包含错误
也许您也可以共享xml跟踪文件,这样我们可以为您提供更多帮助 祝你好运