arcgis-maps-sdk-kotlin-samples icon indicating copy to clipboard operation
arcgis-maps-sdk-kotlin-samples copied to clipboard

The quest about use ModelSceneSymbol when load gltf file is not correct display

Open 875831461 opened this issue 2 years ago • 0 comments

load some .gltf file is not correct display

Bug

not correct display,only display one cube but the correct has four cube

the model files contails these files : 1.BoxInstanced.gltf 2.geometry.bin 3.instances.bin 4.metadata.bin

and my code is

File rootFolder = getExternalFilesDir(Environment.DIRECTORY_DOWNLOADS);
        File offlineFolder = new File(rootFolder,"SceneSymbolsActivity");
        if (!offlineFolder.exists()){
            System.out.println(offlineFolder.mkdir());
        }
        File testFile = new File(offlineFolder,"BoxInstanced");
        File modelFile = new File(testFile,"BoxInstanced.gltf");
        if (modelFile.exists()){
            final GraphicsOverlay graphicsOverlay = new GraphicsOverlay();
            graphicsOverlay.getSceneProperties().setSurfacePlacement(LayerSceneProperties.SurfacePlacement.RELATIVE_TO_SCENE);
            final ModelSceneSymbol modelSymbol = new ModelSceneSymbol(modelFile.getPath(), 1.0);
            modelSymbol.addLoadStatusChangedListener(new LoadStatusChangedListener() {
                @Override
                public void loadStatusChanged(LoadStatusChangedEvent loadStatusChangedEvent) {
                }
            });
            Point point = new Point(-117.142248, 32.746995, 30, SpatialReferences.getWgs84());
            Graphic aircraftGraphic = new Graphic(point, modelSymbol);
            graphicsOverlay.getGraphics().add(aircraftGraphic);
            binding.scene.getGraphicsOverlays().add(graphicsOverlay);
        }
        Camera camera = new Camera( 32.746995,-117.142248,  14.163334, 25.316931608512924, 85.66144951745304, 0.0);
        binding.scene.setViewpointCameraAsync(camera,2);

download model file address : https://cpay.oss-cn-shenzhen.aliyuncs.com/test/BoxInstanced.rar

875831461 avatar Jun 20 '23 07:06 875831461