Creating my first three.js application. Trying to load a very basic .gltf
model
Here’s the code :
const loader = new GLTFLoader();
loader.load( './a_cup_of_coffee/scene.gltf', function ( gltf ) {
scene.add( gltf.scene );
}, undefined, function ( error ) {
console.error( error );
} );
I’ve also added directional lighting :
const light = new THREE.DirectionalLight(0xffffff, 100);
light.position.set(0,1,0);
light.castShadow = true;
And the result is :
Although, the same model is working fine at https://gltf-viewer.donmccurdy.com
Any ideas please?