[Vuejs]-Javascript: FBXLoader not displaying anything

0👍

Generally you would have the renderer.render(scene, camera) call in a loop, but not always.

In your case, you don’t seem to have a render loop, so you are at least going to need a call to renderer.render(scene, camera) in your loader onload callback.

// set up your renderer first.
var renderer = new THREE.WebGLRenderer();
renderer.setPixelRatio(window.devicePixelRatio);
renderer.setSize(500, 500);
var container = document.getElementById("ava");
container.appendChild(renderer.domElement);
renderer.render(scene, camera);

var loader = new THREE.FBXLoader(manager);
loader.load(xhr.responseURL, function(geometry) {
  mesh = new THREE.Mesh( geometry, new THREE.MeshNormalMaterial() );
  mesh.scale.set( 10, 10, 10 );
  mesh.position.y = 150;
  mesh.position.x = 0;
  scene.add(mesh);
  console.log(mesh);
  // Call render here as a mesh has been added.
  renderer.render(scene, camera);
}, onProgress, onError);

Leave a comment