How to use the GLTL models inside arcgis

106
3
11-27-2019 04:24 AM
LucasLiu
New Contributor

Hey all,

I'm now using ArcGIS to build a 3D map, I downloaded the gltl model from the web and injected it inside the project.

Then I want to use this model as the symbol, I checked the API that in Mesh has the method called 'createFromGLTF', then I tried to load the gltl model into the mesh and then draw it on the map, but it doesn't work.

Can you help me to check what's the problem? or how to use the mesh component? The document is not too clear about that.

The model I used is here:

Avro Lancaster - Download Free 3D model by helijah (@helijah) - Sketchfab 

thanks..

Mesh.createFromGLTF(
          new Point({
            x: 58.226,
            y: 28.271,
          }),
          '/scene.gltf',
        ).then(mesh => {
          let graphic = new Graphic({
            geometry: mesh,
            symbol: {
              type: 'mesh-3d',
              symbolLayers: [{ type: 'fill' }],
            },
          });

          view.graphics.add(graphic);
        });
Tags (2)
Reply
0 Kudos
3 Replies
zhiminzhang
New Contributor II

I think you should start with external renderer like this example Use three.js from an external renderer | ArcGIS API for JavaScript 4.13 

Reply
0 Kudos
Noah-Sager
Esri Regular Contributor

You can also take a look at this sample that shows how to add glTF models to a 3D SceneView:

Import glTF 3D Models | ArcGIS API for JavaScript 4.13 

SaschaBrunner1
Esri Contributor

Check this page for more information about visualizing points with 3D symbols:
Visualizing points with 3D symbols | ArcGIS API for JavaScript 4.13 
It includes also more information about the glTF format.

And ObjectSymbol3DLayer - resource where to set the link to the glTF.