How to choose proper radius for SCNSphere?

213 Views Asked by At

I'm working on a 360 image viewer and I use SCNSphere for that. The question is what radius should I use when I create a sphere?

So far I noticed that setting a radius anywhere between 10 and 100 works just fine on my image. However, assuming that image is wrapping sphere around, shouldn't the radius be 2*Pi / image.width (where C = 2*Pi*R)?? Somehow that doesn't work at all on the image I'm using which is of size 1600 x 800.

Here's my code:

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

To clarify the question: How to choose proper radius for SCNSphere with image (let's say of size 1600x800) as a material?

Thanks!

0

There are 0 best solutions below