Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
875831461 opened this issue Jun 20, 2023 · 0 comments

Comments

@875831461
Copy link

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant