Git Product home page Git Product logo

Comments (2)

javagl avatar javagl commented on June 2, 2024

Until recently, the b3dmToGlb command did extract the GLB data from the B3DM, and (always) upgraded it with gltf-pipeline. In version 0.3.0 this was changed: The goal was to make sure that the b3dmToGlb function really extracts the true data, as-it-is.

But... yes, "as-it-is" currently means that it does include the padding bytes. And this may not be the smartest thing to do. I can not imagine a reason why someone would want these bytes in a GLB file. They are not part of the GLB itself. They are only required for the validity of the B3DM. But tools that only want the GLB data might choke on these unnecessary bytes.

This was already fixed in the 3d-tiles-validator, via CesiumGS/3d-tiles-validator#258 (with a stripPadding function). But the 3d-tiles-tools still extract that whole data.

I'm a bit on the fence about where exactly the padding bytes should be omitted. Reading B3DM data into a TileData object can be done like this:

    const tileData = TileFormats.readTileData(b3dmBuffer);
    const glbBuffer = tileData.payload;

This glbBuffer then is the GLB buffer, including the padding. And I think that it should still contain the padding, because ... that's what it is. But for the command-line functions that write GLB data to files, the padding bytes should definitely be omitted before writing the files. So there should probably be a "public" convenience function like that stripPadding from the validator, which is called before writing the actual file data.

I'll address that in a PR soon (including some other, minor issues).

from 3d-tiles-tools.

javagl avatar javagl commented on June 2, 2024

This might now already be fixed with #83 . The "roundtrip" of GLB->B3DM->GLB should now result in a GLB file without the padding bytes.

from 3d-tiles-tools.

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.