I have create a python web server with interface (home.html, in the folder templates). So I try to add a 3D object with extension: .fbx but when I add this, just a black screen appears.
And in the console, I have this error:
GET https://cdn.jsdelivr.net/gh/mrdoob/three.js/examples/js/loaders/FBXLoader.js net::ERR_ABORTED 403
Uncaught TypeError: THREE.FBXLoader is not a constructor
at (index):260:17
And now this is my html code:
<div class="right"></div>
<script src="https://cdn.jsdelivr.net/npm/[email protected]/build/three.min.js"></script>
<script src="https://cdn.jsdelivr.net/gh/mrdoob/three.js/examples/js/loaders/FBXLoader.js"></script>
<script>
// Créer la scène
var scene = new THREE.Scene();
// Créer la caméra
var camera = new THREE.PerspectiveCamera(75, window.innerWidth/window.innerHeight, 0.1, 1000);
camera.position.z = 5;
// Créer le rendu
var renderer = new THREE.WebGLRenderer();
renderer.setSize(window.innerWidth, window.innerHeight);
// Ajouter le rendu à la div "right"
document.querySelector(".right").appendChild(renderer.domElement);
// Charger le fichier .fbx
var loader = new THREE.FBXLoader();
loader.load('Rack.fbx', function (object) {
scene.add(object);
});
// Fonction d'animation
function animate() {
requestAnimationFrame(animate);
renderer.render(scene, camera);
}
animate();
</script>
And for information, ‘Rack.fbx‘ is in same folder that home.html.