I want to make a Saturn ring wrapped by an image in circular manner, so it looks real. The Sphere is completely fine, the only issue is with ring node.
What I want:
What I have tried:
let saturnRingNode = scene?.rootNode.childNode(withName: "saturn_ring", recursively: true)
let ring = UIImage(named: "saturn_ring")
saturnRingNode?.geometry?.firstMaterial?.diffuse.contents = ring
Here is my saturn_ring
image:
How does it look:
I also tried to rotate materials as following code. But I thing it is not rendering in circular manner. It is just changing the direction of the lines.
if let material = saturnRingNode?.geometry?.firstMaterial {
material.diffuse.contentsTransform = SCNMatrix4MakeRotation(Float.pi / 2, 0, 0, 1)
}
I have tried AI tools, Apple developer community but couldn't find anything.
I replaced a tube
with a torus
and rotated the texture image 90 degrees. XCode did the mapping itself.
let saturnRingNode = scene?.rootNode.childNode(withName: "saturn_ring", recursively: true)
let ring = UIImage(named: "saturn_ring")
saturnRingNode?.geometry?.firstMaterial?.diffuse.contents = ring
How to control the height of this torus?
Node inspector
→ Transforms
→ Set the Y
scale to 0
How does it look?