Dip*_*hra 5 iphone xcode objective-c augmented-reality
我正在使用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];
Run Code Online (Sandbox Code Playgroud)
这显示了所有重叠的液滴.我需要解决方案如何解决这个问题,或者我在这里做错了什么,显示位置一个在另一个上面.请注意,我的情况下所有的水滴都有不同的纬度和经度.我测试过了.
| 归档时间: |
|
| 查看次数: |
524 次 |
| 最近记录: |