Migrating from 2.01 to 2.03
See original GitHub issueA year ago i started working on a glTF converter tool (custom format -> glTF and vice versa) and it was fairly easy to do using this library, i never fully finished the project and decided to start working on it again now.
Last time i simply referred to jgltf-obj and built it based on that.
However now i decided to upgrade to the latest jgltf model (at least latest in mavenrepository) and seems like a lot has changed.
To be more specific, one specific class BufferStructureBuilder
which i used heavily no longer exists, so code like this:
public void exportJointsAndWeights() {
List<ByteBuffer> buffers = writeJointsAndWeights(bones);
int jointsAccessorIndex = bufferStructureBuilder.getNumAccessorModels();
bufferStructureBuilder.createAccessorModel("jointsAccessor_" + jointsAccessorIndex,
GltfConstants.GL_UNSIGNED_SHORT, "VEC4", buffers.get(0));
meshPrimitive.addAttributes("JOINTS_0", jointsAccessorIndex);
bufferStructureBuilder.createArrayElementBufferViewModel(
"joints_bufferView");
int weightsAccessorIndex = bufferStructureBuilder.getNumAccessorModels();
bufferStructureBuilder.createAccessorModel("weightsAccessor_" + weightsAccessorIndex,
GltfConstants.GL_FLOAT, "VEC4", buffers.get(1));
meshPrimitive.addAttributes("WEIGHTS_0", weightsAccessorIndex);
bufferStructureBuilder.createArrayElementBufferViewModel(
"weights_bufferView");
}
no longer compiles.
Edit: im aware that BufferStructureBuilder
was only supposed to be used internally as i remember you mentioning it in an issue i made a while ago: https://github.com/javagl/JglTF/issues/55#issuecomment-980072858
So i believe my main question is what’s the easiest way currently to construct a glTF file from a set of data (vertices, indices, normals, materials, joints/bones etc) as im aware that i probably have to rewrite most of my current code (probably best bet would be to just start from scratch). I also don’t mind using ‘non-released modules’ like the jgltf-model-builder (at least i didn’t find a release of it in maven repo) or any other branches that are more up to date but just isn’t released yet as i can just clone these easily rather easily and include in my project if it does make it any easier
Issue Analytics
- State:
- Created a year ago
- Comments:5 (2 by maintainers)
Top GitHub Comments
The
jgltf-model-builder
library should already be published, as of https://repo1.maven.org/maven2/de/javagl/jgltf-model-builder/2.0.3/ .I guess the relevant point here is: This library is not part of
jgltf-model
. (It only depends onjgltf-model
). The reason behind that is that some people might want to usejgltf-model
, but may not needjgltf-model-builder
.Try adding the following dependency to your
pom.xml
:I haven’t looked into the details of possible sponsorship, and somehow doubt that there’s soooo much interest in what I’m doing: Nearly everything that I’m doing also exists as a *Script-npm library, often backed by large companies and many contributors (yes, sometimes sponsored). Setting up the infrastructure for sponsoring (including tax forms and whatnot) would probably not be worth the hassle. (I’m a freelancer, though. Wrapping a certain task into a fixed-price, fixed-time work contract could be much easier and goal-oriented…)
Thanks, everything works exactly as before now.
at least for this project i don’t think that’s the case as this is the only library i found that allowed me to easily construct glTF models in java from a set of data(positions, vertices, tex coords, joints, weights etc) and reading a glTF was very easy as well