Three.js: glb model doesn't appear in threejs but is shown in drag-and-drop viewers

Created on 26 Jun 2020  路  1Comment  路  Source: mrdoob/three.js

Description of the problem

Model called flower01.glb doesn't appear in the scene, though it is visible in both drag-and-drop viewers for three.js and babylon.js.

Code is modified from the source in this tutorial:

https://discoverthreejs.com/book/first-steps/load-models/

Full source with model here:

http://renickbell.net/threejs/flower-model-bug-200626.zip

Filing as a bug as per instructions here:

https://threejs.org/docs/#manual/en/introduction/Loading-3D-models

Three.js version
  • [ ] Dev
  • [X] r118
  • [ ] ...
Browser
  • [] All of them
  • [X ] Chrome
  • [X] Firefox
  • [ ] Internet Explorer
OS
  • [] All of them
  • [ ] Windows
  • [ ] macOS
  • [X ] Linux
  • [ ] Android
  • [ ] iOS
Hardware Requirements (graphics card, VR Device, ...)
Help (please use the forum)

Most helpful comment

Sorry, but this is no bug. You just add the flower glTF asset not correctly to the scene. It shouldn't be

const model = gltf.scene.children[ 0 ];
scene.add( model );

but

scene.add( gltf.scene );

Extracting the first children is not really a best practice since you probably loose important transformation data.

Please use the forum for more help.

>All comments

Sorry, but this is no bug. You just add the flower glTF asset not correctly to the scene. It shouldn't be

const model = gltf.scene.children[ 0 ];
scene.add( model );

but

scene.add( gltf.scene );

Extracting the first children is not really a best practice since you probably loose important transformation data.

Please use the forum for more help.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

boyravikumar picture boyravikumar  路  3Comments

donmccurdy picture donmccurdy  路  3Comments

scrubs picture scrubs  路  3Comments

fuzihaofzh picture fuzihaofzh  路  3Comments

konijn picture konijn  路  3Comments