H42
H42

Reputation: 825

How to avoid transparency of the inner surface in WebGL?

I have the code below. I want both sides of the partial sphere to be non-transparent. Currently, the outer surface is non-transparent, while the inner surface is transparent. What should I do to fix it? Thanks.

var sphere_geometry = new THREE.SphereGeometry(15, 32, 32, Math.PI + Math.PI/2, Math.PI/2, 0, Math.PI/2);
var sphere_material = new THREE.MeshLambertMaterial({ color: 0xFFFF00 });
var sphere = new THREE.Mesh( sphere_geometry, sphere_material );

enter image description here

Upvotes: 1

Views: 33

Answers (1)

jscastro
jscastro

Reputation: 3780

Just do the material double side


var sphere_material = new THREE.MeshLambertMaterial({ color: 0xFFFF00, side: THREE.DoubleSide });

Here’s the link to the official doc of THREE.Material

Upvotes: 2

Related Questions