let scene, camera, renderer, hlight;
scene = new THREE.Scene();
scene.background = new THREE.Color(0xdddddd);
camera = new THREE.PerspectiveCamera(40, window.innerWidth / window.innerHeight, 1, 5000);
camera.position.set(0, 0, 10);
hlight = new THREE.AmbientLight(0x404040, 10);
scene.add(hlight);
renderer = new THREE.WebGLRenderer({ antialias: true });
renderer.setSize(window.innerWidth, window.innerHeight);
renderer.outputEncoding = THREE.sRGBEncoding;
this.cheese.appendChild(renderer.domElement);
const loader = new GLTFLoader();
loader.load('./nara/scene.gltf', function (gltf) {
console.log('anything here success?', gltf);
scene.add(gltf.scene);
renderer.render(scene, camera);
}, undefined, function (error) {
console.log('anything here?');
console.error(error);
});
I think I am missing something.
I used https://gltf-viewer.donmccurdy.com/ to confirm that the model is working normally.