Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I invert the normal of a sphere in SceneKit?

I have a sphere with a texture on the outer side. I want the texture to be on the inside of the sphere. The outside should be transparant, so texturing both sides won't work.

I want to use the sphere for an AR portal to display 360 content.

like image 404
Teun van den Braber Avatar asked Oct 22 '25 18:10

Teun van den Braber


1 Answers

Set the cullMode property of the SCNMaterial to front instead of the default back. The doubleSided property has to be NO/false. Both sides are textured by default, setting the cull mode to front will cause it to render only back facing faces, as if the normals are flipped, and will give you the desired results.

like image 112
Xartec Avatar answered Oct 25 '25 09:10

Xartec