gpt4 book ai didi

iphone - iPhone ARKit 中的位置在一处重叠

转载 作者:太空狗 更新时间:2023-10-30 03:54:48 25 4
gpt4 key购买 nike

我正在为我的一款增强现实应用程序使用 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];

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

最佳答案

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

关于iphone - iPhone ARKit 中的位置在一处重叠,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/12541392/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com