I am currently diving into learning three.js and have been closely following their documentation. However, I seem to be facing an issue when trying to import an object from Blender. Can anyone point out what might be going wrong here? I have set up the scene, camera, renderer, and loader as needed.
import * as THREE from "https://cdn.skypack.dev/<a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="89fde1fbececc9b9a7b8bab8a7ba">[email protected]</a>";
import { GLTFLoader } from "path/";
const scene = new THREE.Scene();
const camera = new THREE.PerspectiveCamera(
75,
window.innerWidth / window.innerHeight,
0.1,
1000
);
const renderer = new THREE.WebGLRenderer();
renderer.setSize(window.innerWidth, window.innerHeight);
document.body.appendChild(renderer.domElement);
const loader = new GLTFLoader();
loader.load(
"path/object.glb",
function (gltf) {
scene.add(gltf.scene);
},
undefined,
function (error) {
console.error(error);
}
);
renderer.render(scene, camera);