I'm having trouble displaying a GLTF model using three.js. If someone could help me identify the issue in my code, I would greatly appreciate it.
import {GLTFLoader} from "./GLTFLoader.js";
var scene = new THREE.Scene();
var camera = new THREE.PerspectiveCamera(
75,
window.innerWidth/window.innerHeight,
.01,
1000
);
var renderer = new THREE.WebGLRenderer();
renderer.setSize(window.innerWidth,window.innerHeight);
document.body.appendChild(renderer.domElement);
var loader = new THREE.GLTFLoader();
loader.load("scene.gltf",function(gltf){
var obj;
scene.add(gltf.scene);
});
var light = new THREE.HemisphereLight(0xFFFFFF, 0x000000, 2);
scene.add(light);
camera.position.set(0,0,100);
function animate(){
requestAnimationFrame(animate);
renderer.render(scene,camera);
}
animate();