gpt4 book ai didi

swift - 如何修复MapBox sceneKit(AR场景)的 'Extra argument '缩放“通话中”?

转载 作者:行者123 更新时间:2023-11-30 10:50:45 26 4
gpt4 key购买 nike

该错误表明它不需要“zoom”参数,但所有在线文档都另有说明。

当我删除“zoom”参数时,它再次出错并说它需要两个参数。我是否缺少另一个需要添加的参数?

此外,我尝试使用“乘数”参数,有人建议使用它,但也不起作用。

func createTerrain() {
terrainNode = TerrainNode(minLat: minLat, maxLat: maxLat,
minLon: minLon, maxLon: maxLon)

if let terrainNode = terrainNode {
terrainNode.scale = terrainNodeScale // Scale down map
terrainNode.position = SCNVector3Make(0, -0.15, 0) // Place map slightly below clouds
terrainNode.geometry?.materials = defaultMaterials() // Add default materials
scene.rootNode.addChildNode(terrainNode)

terrainNode.fetchTerrainHeights(minWallHeight: 100.0, enableDynamicShadows: true, progress: { progress, total in
}, completion: {
NSLog("Terrain load complete")
})

terrainNode.fetchTerrainTexture("mapbox/satellite-v9", zoom: 14, progress: { progress, total in
}, completion: { image in
NSLog("Texture load complete")
terrainNode.geometry?.materials[4].diffuse.contents = image
})
}
}

这是将地形纹理和卫星图像传输到地形节点的代码部分。我认为我需要知道“缩放”级别,但它希望将其删除。

任何帮助将不胜感激,因为我目前正在扯头发。非常感谢任何看到这篇文章并提出建议的人。

Screenshot of error

最佳答案

fetchTextureTerrain 方法似乎已从您的更改:

terrainNode.fetchTerrainTexture("mapbox/satellite-v9", zoom: 14, progress: { progress, total in
}, completion: { image in
NSLog("Texture load complete")
terrainNode.geometry?.materials[4].diffuse.contents = image
})

类似于:

terrainNode.fetchTerrainTexture("mapbox/satellite-v9", progress: { progress, total in
// Some code here.

}, completion: { image, fetchError in
if let fetchError = fetchError {
NSLog("Texture load failed: \(fetchError.localizedDescription)")
}
if image != nil {
NSLog("Texture load complete")
terrainNode.geometry?.materials[4].diffuse.contents = image
}
})

请注意完成 block 中额外的 fetchError 术语(以及删除您之前注意到的 zoom 术语)。不相关,但为了纯粹的快速实现,您应该使用 print 语句并避免 NSLog

关于swift - 如何修复MapBox sceneKit(AR场景)的 'Extra argument '缩放“通话中”?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/54601357/

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