When my camera moves inside my gltf object, I can see the interior and texture. Is there a way to avoid this?
The is my scenes clear color. The is the outside faces of my object. is the visible inside of my object.
Is there something I can do inside of either blender or three.js to make this work?
I tried:
mesh.singleSided = true;
and
mesh.doubleSided = false;
but i can still see the inside of my sphere.
The whole object looks like this:
function addMesh (){
meshGroup = new THREE.Object3D();
var texture = new THREE.Texture();
var manager = new THREE.LoadingManager();
manager.onProgress = function ( item, loaded, total ) {};
var onProgress = function ( xhr ) {};
var onError = function ( xhr ) {};
var loader = new THREE.GLTFLoader();
// Load a glTF resource
loader.load(
// resource URL
'assets/tatp3.gltf',
// called when the resource is loaded
function ( gltf ) {
mesh = gltf.scene;
mesh.scale.set( 8, 8, 8 );
mesh.singleSided = true;
meshGroup.add(mesh);
meshGroup.add(meshGroup2);
meshGroup.position.x = 0
meshGroup.position.y = 0
meshGroup.position.z = 0
scene.add( meshGroup );
//scene.add( gltf.scene );
//gltf.animations; // Array<THREE.AnimationClip>
//gltf.scene; // THREE.Scene
//gltf.scenes; // Array<THREE.Scene>
//gltf.cameras; // Array<THREE.Camera>
//gltf.asset; // Object
},
// called when loading is in progresses
function ( xhr ) {
console.log( ( xhr.loaded / xhr.total * 100 ) + '% loaded' );
},
// called when loading has errors
function ( error ) {
console.log( 'An error happened' );
}
);
}