0

当我使用这个演示时,我使用了 xcode 8.0 和 os 版本 9.3.5,我无法打开相机。

首先我把对象这个屏幕工作正常但是当点击完成按钮而不是显示白屏之后。这个屏幕上什么都没有显示。

我用了这个Demo

https://github.com/kudan-eu/GPSSample-iOS

这是我的截图 在此处输入图像描述

这是我的代码

地图视图控制器.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)
4

1 回答 1

0

我使用了不同的 ARAPIKey 但最后我得到了正确的 ARAPIKey

 [[ARAPIKey sharedInstance] setAPIKey:@"sVmoznmKZ+4nFEHD6HoslwpC26PNuBZGHrikUwyon2BKSvza1yu2CqbSrae+pHPr1NHjhsf5pHQOZn8IEqXlqXFodGsrOJhxJANbMOdvnRLUi9/QWGqyRL9FViDmyohw6e5R7U4Ex8H7d7spLLvhfp5HFv56DgLr8c8sC2ipDtv9g1IjOTaY7UGxata3eulG2A/UkIdRv2NcotZXqan01xQUWFAislEwlGguParEYiwu11T4mqtU3dQBbfxpvxbczjdYz493YG3rAO2RHgT+5M5TJShJsz2irkNo71JD2Fzqf4AR2b4+7t1c55zKjegXzGS6Xa/rpNn9yiXUn7rUYIHNvN3cEQa9HsZiVxAV4vJgxFS+T/AxfWqKrEg1uj6xF5MsodZ2EkZ8mqliYIsxZqnFz+Re2HeWG8wvrEob0ZwRIO0TxppAemZc3HChTAPLcNt5gzeBk0oRP4wnrFAFFBDi8XjDocwTSVw++hWZb1qNHzt6bKLsMDRT057UVuuZB6M8f7EOQD79Oah0Vrx/3DUK6e9BEV8oGFNHtk1wyYEkg0i6RLhVSokGx//Qj36A4gCz3h1OjtfB0OuukbNq7xI1L/FcNQLmGYNGZwszARjGr9ESw1gVAkbQMxaV27uo/KoIq4+nR7RL8iT7t7NAaXCFIi24RR+7WGjTvKqWYjA="];

如果此 ARAPIKey 已过期,则获取新密钥https://wiki.kudan.eu/Development_License_Keys

于 2017-03-01T08:21:41.143 回答