Mark E
Mark E

Reputation: 3483

Changing view side of SCNSphere in SceneKit for iOS

I'm starting with the SceneKit, I want to create a sphere and add a panoramic image as a texture inside the sphere, the problem is I can't change the normal vectors of the sphere to the inside, so actually when seen from the inside is invisible and I want to put the camera at the center of the sphere to see the panoramic image around the camera.

Upvotes: 1

Views: 1046

Answers (1)

rickster
rickster

Reputation: 126167

If you make the sphere's material doubleSided, then the back faces will automatically be rendered as if their normals were inverted, so you'll be able to see the inside of the sphere with proper shading if the camera (and maybe some light) is inside it.

If you're looking for a skybox effect, you can also get that without adding any geometry to your scene, simply by adding an array of six images to the contents of the scene's background property.

Upvotes: 3

Related Questions