I am unable to load any Gltf file, I tried everything.
This is my test link
It says infinity% loaded but it is not loaded…
Can you help me out!
Thanks!
xhr.total
is always 0
in your app because of the following reason:
Dividing a number though zero produces Infinity
.
Besides, I suggest you add some lights to your scene, otherwise you won’t be able to see the model (which is actually fine, validate via https://gltf-viewer.donmccurdy.com/).
Thanks for your help, I really appreciate it!
but, I just added a light and I am still unable to see any object…
Do you see the shape of the model when adding a white background like so:
scene.background = new THREE.Color( 0xffffff );
I entered the code, but my background is still black.
Try to call animate()
. Right now, you are not animating your scene.
Do I need to make an animation loop?
Well, you have to render your scene at least once after the glTF
asset has been loaded and when you interact with the scene (e.g. change the camera). Read this for more information:
I deleted the loop, and my canvas is white, but now I still do not see the car.
edit: right now I added: setTimout(renderLooping, 1000) function renderLooping(){ setTimout(renderLooping, 1000) renderer.render( scene, camera ); }
So every second the canvas is updated.
Your code produces a runtime error:
Uncaught ReferenceError: setTimout is not defined
There is a typo in your function call.
I suggest you make yourself a bit more familiar with JavaScript and the basics of three.js
. All your questions in this thread will be then automatically be answered.
Yeah i just noticed, oops.
Thanks for your help, i really appreciate it, and i learned alot!