With the GltfModifier added to Cesium Native, there's more reason than ever for someone to have a need to manipulate glTFs, not just read from them, using this library. Currently, creating or modifying a glTF using Cesium Native means manually creating all the buffers, buffer views, accessors, meshes, mesh primitives, etc., etc.. We can probably provide a simpler API to make this process more convenient.
One idea is some sort of ModelBuilder class. Something like this:
ModelBuilder builder;
ModelMeshBuilder meshBuilder = builder.createMesh();
ModelMeshPrimitiveBuilder primitiveBuilder = meshBuilder.createPrimitive();
primitiveBuilder.setIndices(indicesArr);
primitiveBuilder.addAttribute("POSITION", positionArr);
Model model = builder.finalize();
But there are a lot of other ways to design this, and there are plenty of other utility functions we could come up with that would be helpful for this task.
With the
GltfModifieradded to Cesium Native, there's more reason than ever for someone to have a need to manipulate glTFs, not just read from them, using this library. Currently, creating or modifying a glTF using Cesium Native means manually creating all the buffers, buffer views, accessors, meshes, mesh primitives, etc., etc.. We can probably provide a simpler API to make this process more convenient.One idea is some sort of
ModelBuilderclass. Something like this:ModelBuilder builder; ModelMeshBuilder meshBuilder = builder.createMesh(); ModelMeshPrimitiveBuilder primitiveBuilder = meshBuilder.createPrimitive(); primitiveBuilder.setIndices(indicesArr); primitiveBuilder.addAttribute("POSITION", positionArr); Model model = builder.finalize();But there are a lot of other ways to design this, and there are plenty of other utility functions we could come up with that would be helpful for this task.