Code Monkey home page Code Monkey logo

Comments (7)

donatomarro avatar donatomarro commented on August 18, 2024

So I was able to fix this problem now. :-)

In addition to move the 'generate gltf model from collada' block behind the 'image saving' block (otherwise the collada2gltf tool will start converting before all textures are written to disk) you also have to change the following lines

ProcessBuilder pb = new ProcessBuilder(collada2gltfPath, "-f", buildingDirectory + File.separator + colladaBundle.getGmlId() + ".dae",  "-e", "true"); 
pb.start();

into

ProcessBuilder pb = new ProcessBuilder(collada2gltfPath, "-f", colladaBundle.getGmlId() + ".dae",  "-e", "true");
pb.directory(buildingDirectory);
pb.start();

to set the right working directory for collada2gltf to make it find the texture files.

from importer-exporter.

yaozhihang avatar yaozhihang commented on August 18, 2024

Hi Donato,

thank you for your input.

There are two reasons why I don't want the textures to be embedded in the glTF file.

  1. The entire files size can be reduced since the exported .dae and .gltf assets share the common textures
  2. Cesium (starting from version 1.16 ) supports incremental loading of glTF model’s textures. This feature may give a better user experience when loading glTF models with detached textures.

best regards,

Zhihang

from importer-exporter.

donatomarro avatar donatomarro commented on August 18, 2024

Hi Zhihang,

The entire files size can be reduced since the exported .dae and .gltf assets share the common textures

But in which case would you need both, the .dae and the .gltf files? I made some changes to the exporter so that the .dae and .jpeg files will be deleted after creating the .gltf, and the .kml files will reference the .gltf file instead of the .dae. So there isn't an increase in files size.

Cesium (starting from version 1.16 ) supports incremental loading of glTF model’s textures. This feature may give a better user experience when loading glTF models with detached textures.

Yes, I noticed that. So I will go back to detached textures I guess.

Best regards,
Donato

from importer-exporter.

yaozhihang avatar yaozhihang commented on August 18, 2024

Hi Donato,

combined with COLLADA .dae files the exported 3D models can be visualized not only in Cesium but also in Google Earth by using the KML file which is located in the same folder as the master JSON file. It could be useful in many use cases.

best regards,

Zhihang

from importer-exporter.

donatomarro avatar donatomarro commented on August 18, 2024

Hi Zhihang,

I see. I'm still wondering how the exported gltf files are loaded into Cesium. Maybe you can give me a little hint about this?

In my application I'm adding a new collada layer like this:

colladaLayer = new CitydbKmlLayer({
    url : './data/berlin_collada_MasterJSON.json'
});

It works fine. And it still works when I'm deleting the .dae files so that there are only the .gltf and .jpeg files left in the tiles directories. I wasn't able to find out how the .gltf files are referenced, since the files like berlin_Tile_0_1_collada.kml only contain links to the .dae files.

Best regards,
Donato

from importer-exporter.

yaozhihang avatar yaozhihang commented on August 18, 2024

Hi Donato,

the referencing of .dae files is internally switched to the glTF files by the 3dcitydb-web-map
https://github.com/3dcitydb/3dcitydb-web-map/blob/master/js/CitydbKmlDataSource.js#L1341

best regards,

Zhihang

from importer-exporter.

donatomarro avatar donatomarro commented on August 18, 2024

Hi Zhihang,

found the code line one minute ago. ;-) But thanks!

Best regards
Donato

from importer-exporter.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.