我正在遵循Metaio网站上的教程-创建一个新的AR应用程序,它似乎起作用了(我得到Metaio闪屏,当我在ipad上构建和运行它时,水印显示在相机视图上。
我正在尝试使用直接从Metaio SDK复制的代码来运行Hello World教程,但我无法让模型显示在机架图像上。
实现文件代码如下-当我在ipad上运行它时,我没有得到任何错误,并获得相机视图等,但没有3d模型-有什么建议吗?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发布于 2014-09-25 00:10:12
您是否还使用了应该位于assets文件夹中的xml跟踪文件?在我看来,它可能来自几个错误:
也许您也可以共享xml跟踪文件,这样我们可以为您提供更多帮助。
祝好运
https://stackoverflow.com/questions/25854848
复制相似问题