Giter Site home page Giter Site logo

Comments (7)

Dancovich avatar Dancovich commented on September 27, 2024

I'm not too familiar with the G3DB format. Looking at the format specification it seems that it's just the G3DJ file with no line breaks and written as a byte array but I can be wrong.

Anyway I found out there's a UBJsonWriter class in LibGDX nightly so I'll try to use that to write a converter in Java that will batch convert G3DJ files in a folder.

Thanks for trying my converter and for the suggestion.

from libgdx_blender_g3d_exporter.

VinceAngel avatar VinceAngel commented on September 27, 2024

Maybe we could ask Xoppa to have more detailed explanations on the binary format.

from libgdx_blender_g3d_exporter.

Dancovich avatar Dancovich commented on September 27, 2024

That was quick.

https://github.com/Dancovich/libgdx_g3db_converter

As I imagined the G3DB format is just a JSON format output as a byte stream. There are certain details about the binary format like how many bytes to use for long, char, etc.

So I just used the provided UBJsonWriter. It really can output any JSON file to binary format, not just G3D models, and it already takes care of binary format issues.

Did some preliminary tests with a default model and it loaded without issues. Just remember to instantiate your model loader with G3dModelLoader loader = new G3dModelLoader(new UBJsonReader()). Notice the use of UBJsonReader instead of JsonReader, it's necessary or else your model won't load.

I'm closing this issue for now. Please, if you can, do some testing and post any issues you find in the converter repository.

from libgdx_blender_g3d_exporter.

VinceAngel avatar VinceAngel commented on September 27, 2024

Nice ! thanks.
I'll have a look ASAP

from libgdx_blender_g3d_exporter.

VinceAngel avatar VinceAngel commented on September 27, 2024

Just to be sure to understand : with the UBJsonWriter I can write a g3db file from a g3dj file red using G3dModelLoader loader = new G3dModelLoader(new UBJsonReader()) ?
Would it be hard to write it from the exporter plugin (I don't know python, or not yet ^^ ) to avoid having to use some code for writing the binary file ?

from libgdx_blender_g3d_exporter.

Dancovich avatar Dancovich commented on September 27, 2024

Just use the code on the link I provided.

https://github.com/Dancovich/libgdx_g3db_converter

This code will read a folder and output any g3dj files it finds into a g3db file. The README.md contains usage instructions. You can call it from the command line, no need to embed it into your code.

This code depends on the main GDX library. If you use Maven the provided pom.xml is already configured to depend on it.

from libgdx_blender_g3d_exporter.

VinceAngel avatar VinceAngel commented on September 27, 2024

Ho I see :-)
Thanks a lot for this fast work you did !

from libgdx_blender_g3d_exporter.

Related Issues (18)

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.