CesiumGS / CesiumGS/cesium-native

An easier way to create glTF models from code

Open
#1,304 1 comment 1 reaction 0 assignees View on GitHub
enhancement quality research
Dominant language
C++
Stars
623
Forks
277
PR merge metrics
No merged PRs in 30d

Description

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:
```cpp
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.

Contributor guide

Open the contributing guide

Research direction

Start by reviewing the existing GltfModifier API and the current manual construction of buffers, buffer views, accessors, meshes, and mesh primitives. Compare possible builder designs against the stated POSITION and index examples, then define the API scope and acceptance criteria with maintainers. Done means an agreed, convenient way to create or modify glTF models rather than a particular design assumed by this issue.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp
Domain
computer-graphics
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.