Home>

I want to get the vertex coordinates of the 3D model (3ds file) read with the following code in three.js.
What should I do?

Applicable source code
const loader = new THREE.TDSLoader ();
loader.setPath ('imgs /');
loader.load ('js/3ds.3ds', (object) =>{
Scene.add (object);
});
  • Answer # 1

    If it's just after loading,

    loader.load ('js/3ds.3ds', (object) =>{
      object.children [0] .geometry.vertices
      scene.add (object);
    });

    In this vertices, you can get it as an array.

  • Answer # 2

    Because it is difficult to handle in binary format, convert it to JSON.
    The converter will come out if you search, so use the one that suits your purpose.
    Online 3D Converter
    convert-to-threejs