我正在为我的 iOS 项目实现 wikiitude SDK。现在在教程中它一步一步地展示,我正在关注它。有一个添加 ARchitectWorld 的选项。我没有在该文件夹选项中添加什么。我是否必须从他们展示的示例中获取 .js .css 和 .html 文件。我有点困惑。现在我也添加了代码。但没有收获任何成果。我的问题是我应该添加什么代码才能让 ARworld 工作。我正在测试我的第 5 代 iPOD。它向我显示一条消息,屏幕为空白。
消息是This device is not capable of running ARchitect Worlds. Requirements are: iOS 6 or higher, iPhone 3GS or higher, iPad 2 or higher. Note: iPod Touch 4th and 5th generation are only supported in WTAugmentedRealityMode_IR.
我的代码是
- (void)viewDidLoad
{
[super viewDidLoad];
// Do any additional setup after loading the view from its nib.
NSLog(@"here it comes");
if ( [WTArchitectView isDeviceSupportedForAugmentedRealityMode:WTAugmentedRealityMode_Both] ) { // 1
NSLog(@"not entering");
self.architectView = [[WTArchitectView alloc] initWithFrame:self.view.bounds motionManager:nil augmentedRealityMode:WTAugmentedRealityMode_Both];
// [self.architectView setLicenseKey:@"MY-LICENSE-KEY"]; // 2
[self.architectView setLicenseKey:nil];
NSURL *architectWorldUrl = [[NSBundle mainBundle] URLForResource:@"index" withExtension:@"html"];
[self.architectView loadArchitectWorldFromUrl:architectWorldUrl];
[self.view addSubview:self.architectView]; // 3
}
else {
NSLog(@"This device is not capable of running ARchitect Worlds. Requirements are: iOS 6 or higher, iPhone 3GS or higher, iPad 2 or higher. Note: iPod Touch 4th and 5th generation are only supported in WTAugmentedRealityMode_IR.");
}
}
- (void)viewWillAppear:(BOOL)animated
{
[super viewWillAppear:animated];
[self.architectView start];
if ( [self.architectView isRunning] ) {
NSLog(@"ARchitect is running with version: %@", [WTArchitectView versionNumber]);
}else {
NSLog(@"WTARchitectView wasn't able to start. Please check e.g. the -ObjC linker flag in your project settings.");
}
}
- (void)didReceiveMemoryWarning
{
[super didReceiveMemoryWarning];
// Dispose of any resources that can be recreated.
}
-(void)startAR
{
if([self.architectView isRunning])
{
NSLog(@"architect view is working");
[self.architectView start];
}
else{
NSLog(@"architect view is NOT working");
}
}
-(void)stopAR
{
if([self.architectView isRunning])
{
[self.architectView stop];
}
}
需要任何帮助。谢谢。