QUERY:
I am facing an issue where my model appears extremely small after converting the FBX file to a .gltf format. Despite attempting to scale the model using
frontObject.scale.set(1000, 1000, 1000);
, I encounter the following error:
TypeError: Cannot read property 'set' of undefined
In addition, within the code snippet:
function ( xhr ) {
progressBar.style.display = "block";
progressBar.style.width = ( xhr.loaded / xhr.total * 100 ) + '%';
loadingText.innerHTML = 'Loading... '+xhr.loaded+"/"+xhr.total;
// The issue arises as xhr.total is always 0 and xhr.loaded is set to an unusually large value
setTimeout(function () {
frontObject.scale.set(1000, 1000, 1000);
}, 3000);
},
The values for xhr.total remain consistently at 0 while xhr.loaded shows an unexpectedly high number.
All modifications made were strictly limited to converting the original .fbx file to .gltf format and reducing the texture sizes from 2048x2048 to 1024x1024.
Please refer to the screenshot displaying the current state:
https://i.sstatic.net/gD8MM.png
Prior to conversion, the model would occupy the entire vertical height.
SNIPPET:
if (!Detector.webgl) Detector.addGetWebGLMessage();
var container, stats, controls;
var camera, scene, renderer, light;
var clock = new THREE.Clock();
var frontObject;
init();
animate();
function init() {
container = document.createElement('div');
document.body.appendChild(container);
camera = new THREE.PerspectiveCamera(45, window.innerWidth / window.innerHeight, 1, 2000);
camera.position.set(100, 200, 300);
camera.lookAt(new THREE.Vector3(0, 0, 0));
controls = new THREE.OrbitControls(camera);
controls.target.set(0, 100, 0);
controls.update();
scene = new THREE.Scene();
scene.background = new THREE.Color(0xa0a0a0);
scene.fog = new THREE.Fog(0xa0a0a0, 200, 1000);
...
FIDDLE:
https://jsfiddle.net/Username100/y54kpe1h/64 I managed to resolve the sizing issue with the model! However, there seems to be an inconsistency in the default loading manager incorrectly indicating complete loading. Can anyone provide insights on this discrepancy?