このデモを使用するときに、xcode 8.0 と os バージョン 9.3.5 を使用しましたが、カメラを開くことができません。
最初にオブジェクトを配置すると、この画面は正常に動作しますが、完了ボタンをクリックすると、白い画面が表示された後、この画面には何も表示されません。
このデモを使用しました
https://github.com/kudan-eu/GPSSample-iOS
ここに私のコードがあります
mapViewcontroller.m
- (IBAction)progressButton:(id)sender
{
if (self.touchPin) {
[self performSegueWithIdentifier:@"showGPSDemo" sender:self];
}
}
#pragma mark - Navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender
{
if ([[segue identifier] isEqualToString:@"showGPSDemo"]) {
// Set model coordinate to position of the map pin.
CameraViewController *viewController = [segue destinationViewController];
CLLocationCoordinate2D touchPinCoordinate = self.touchPin.coordinate;
viewController.objectCoordinate = [[CLLocation alloc] initWithLatitude:touchPinCoordinate.latitude longitude:touchPinCoordinate.longitude];
}
}
CameraViewController.com
- (void)setupContent
{
// Initialise and start the GPS Manager.
ARGPSManager *gpsManager = [ARGPSManager getInstance];
[gpsManager initialise];
[gpsManager start];
// Initialise a GPSNode with coordinate provided from the map.
ARGPSNode *gpsNode = [[ARGPSNode alloc] initWithLocation:self.objectCoordinate];
// Point the GPS Node due east.
[gpsNode setBearing:90];
// Must add GPSNode as a child to the GPS Manager world.
[gpsManager.world addChild:gpsNode];
// Import the model.
ARModelImporter *modelImporter = [[ARModelImporter alloc] initWithBundled:@"bloodhound.armodel"];
// The ARModel node represents all external contents relating to the model e.g.animations, textures.
ARModelNode *modelNode = [modelImporter getNode];
// Add the modelNode as a child to the GPSNode.
[gpsNode addChild:modelNode];
// Add the texture to the 3D model.
ARTexture *modelTexture = [[ARTexture alloc] initWithUIImage:[UIImage imageNamed:@"bloodhound.png"]];
// Setup the object material.
ARLightMaterial *modelMaterial = [[ARLightMaterial alloc] init];
modelMaterial.colour.texture = modelTexture;
modelMaterial.ambient.value = [ARVector3 vectorWithValuesX:0.5 y:0.5 z:0.5];
modelMaterial.diffuse.value = [ARVector3 vectorWithValuesX:0.5 y:0.5 z:0.5];
// Apply to the model.
for (ARMeshNode *meshNode in modelNode.meshNodes) {
meshNode.material = modelMaterial;
}
// Scale the model to the correct height of Big Ben from model height. Units of the GPSManager world are meters, model is 11008 units high in object space.
[modelNode scaleByUniform:(96.0 / 11008.0)];
self.gpsNode = gpsNode;
}
ここに私のログがあります
Could not find file for texture Big_Ben_spec.png
2016-12-13 16:40:37.546 GPS Sample[13723:834618] RootNode ARVector3(0.000000, 0.000000, 0.000000)
2016-12-13 16:40:37.547 GPS Sample[13723:834618] Big_Ben_001 ARVector3(0.001160, -0.000000, 0.001221)
2016-12-13 16:40:37.547 GPS Sample[13723:834618] Big_Ben_001 ARVector3(0.000000, 0.000000, 0.000000)
2016-12-13 16:40:37.547 GPS Sample[13723:834618] Big_Ben_001 ARVector3(0.000000, 0.000000, 0.000000)
2016-12-13 16:40:37.547 GPS Sample[13723:834618] Big_Ben_001 ARVector3(0.000000, 0.000000, 0.000000)
2016-12-13 16:40:37.547 GPS Sample[13723:834618] Big_Ben_001 ARVector3(0.000000, 0.000000, 0.000000)
2016-12-13 16:40:37.547 GPS Sample[13723:834618] Big_Ben_001 ARVector3(0.000000, 0.000000, 0.000000)
2016-12-13 16:40:39.877 GPS Sample[13723:834618] generated main fbo 2
2016-12-13 16:40:39.885 GPS Sample[13723:834618] created main FBO with width 1536 and height 2048
2016-12-13 16:40:40.281 GPS Sample[13723:834682] camera dimensions: 480.000000 x 640.000000
2016-12-13 16:40:40.282 GPS Sample[13723:834682] camera aspect ratio: 0.750000
2016-12-13 16:40:40.282 GPS Sample[13723:834682] framebuffer aspect ratio: 0.750000
2016-12-13 16:40:40.288 GPS Sample[13723:834682] rotating to orientation 1
2016-12-13 16:40:40.444 GPS Sample[13723:834682] WARNING: Could not find file for texture Big_Ben_diffuseShade.png
2016-12-13 16:40:40.444 GPS Sample[13723:834682] WARNING: Could not find file for texture Big_Ben_spec.png
2016-12-13 16:40:40.461 GPS Sample[13723:834682] RootNode ARVector3(0.000000, 0.000000, 0.000000)
2016-12-13 16:40:40.461 GPS Sample[13723:834682] Big_Ben_001 ARVector3(0.001160, -0.000000, 0.001221)
2016-12-13 16:40:40.462 GPS Sample[13723:834682] Big_Ben_001 ARVector3(0.000000, 0.000000, 0.000000)
2016-12-13 16:40:40.462 GPS Sample[13723:834682] Big_Ben_001 ARVector3(0.000000, 0.000000, 0.000000)
2016-12-13 16:40:40.462 GPS Sample[13723:834682] Big_Ben_001 ARVector3(0.000000, 0.000000, 0.000000)
2016-12-13 16:40:40.462 GPS Sample[13723:834682] Big_Ben_001 ARVector3(0.000000, 0.000000, 0.000000)
2016-12-13 16:40:40.462 GPS Sample[13723:834682] Big_Ben_001 ARVector3(0.000000, 0.000000, 0.000000)
2016-12-13 16:40:49.263 GPS Sample[13723:834618] Error while getting core location : (null)