Skip to content

An easier way to create glTF models from code #1304

@azrogers

Description

@azrogers

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or requestqualityImprove code quality or encourage developer successresearchExplore an idea or prototype a concept and share the results

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions