【问题标题】:Locations in iPhone ARKit overlapping at one placeiPhone ARKit 中的位置在一处重叠
【发布时间】:2012-09-22 06:35:24
【问题描述】:

我正在将 ARKit 用于我的一个增强现实应用程序。但我面临的问题是相机中的位置相互重叠。

当我尝试使用硬编码数据时,我能够在不同位置显示数据。现在我正在从服务器获取数据并将它们显示在 ARKit 上。这显示了所有相互重叠的位置。

这是我的代码:

for (NSDictionary *drop in drops)
{
    CLLocation *tempLocation = [[CLLocation alloc] initWithLatitude:[[[drop objectForKey:@"latitude"] objectForKey:@"text"] floatValue] longitude:[[[drop objectForKey:@"longitude"] objectForKey:@"text"] floatValue]];
    tempCoordinate = [ARGeoCoordinate coordinateWithLocation:tempLocation];
    tempCoordinate.inclination = M_PI/30;
    tempCoordinate.title = [[drop objectForKey:@"DropText"] objectForKey:@"text"];
    tempCoordinate.subtitle = [[drop objectForKey:@"DropPlace"] objectForKey:@"text"];
    tempCoordinate.type=[[[drop objectForKey:@"DropType"] objectForKey:@"text"] intValue];
    [tempLocationArray addObject:tempCoordinate];
    [tempLocation release];

}
[viewController addCoordinates:tempLocationArray];
[viewController startListening];

这显示了所有重叠的水滴。我需要有关如何解决此问题的解决方案,或者我在这里做错了什么,即显示一个位置。请注意,我案例中的所有水滴都有不同的纬度和经度。我已经测试过了。

【问题讨论】:

  • 嗨@Dipak 你有什么解决办法吗?我也面临同样的问题。

标签: iphone objective-c xcode augmented-reality


【解决方案1】:

我的代码没有问题,问题出在服务器上,它为我提供了相同地理位置的所有数据。一旦我开始获取不同地理位置的数据,我的问题就解决了。

【讨论】: