如何为SCNSphere选择合适的半径?

时间:2018-12-09 03:17:22

标签: ios swift scenekit scnnode scnsphere

我正在使用360度图像查看器,为此使用了SCNSphere。问题是创建球体时应该使用哪个半径?

到目前为止,我注意到将半径设置为10到100之间的任何大小都可以很好地处理我的图像。但是,假设图像环绕球体,半径不应为2 * Pi / image.width(其中C = 2 * Pi * R)吗?在我使用的大小为1600 x 800的图像上,某种方式根本不起作用。

这是我的代码:

let material = SCNMaterial()
material.diffuse.contents = image360
let sphere = SCNSphere(radius: 10)
sphere.segmentCount = 300
sphere.firstMaterial = material
let node = SCNNode()
node.geometry = sphere

要澄清一个问题:如何为SCNSphere选择适当的半径,以图像(假设尺寸为1600x800)作为材料?

谢谢!

0 个答案:

没有答案
相关问题