-
Notifications
You must be signed in to change notification settings - Fork 45
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Consider a function to automatically assign IDs to mesh primitives #125
Comments
I started drafting a few possible approaches here. At the moment, this is rather experimental, recreational, brainstorming, ... "let's see how this could be done". And I think that a green-field approach for the task to 'do something', is to define an interface So in the current state, there is an interface
This can receive a bunch of documents, and assign feature IDs to the mesh primitives. Static factories exist for creating different types of feature ID assigners. So for simple patterns, the "surface area of the API" is close to zero:
That's it. It will assign consecutive feature ID values Now, there are a million possible ways of how this could be configured on a more fine-grained level. (Some of them are listed in the first post here). But one important configuration hook is to determine...
So... when there's the goal to provide a feature ID value for a certain primitive of a certain mesh of a certain document, then... there can be an interface (type definition) like this:
An instance of this can be passed to the static factory methods, and allow determining the actual feature ID values. There are some details about the
This feature ID assigner will assign the ID value (Maybe I'll open a draft PR for a demo, but for now, this comment might be enough...) |
The main use case of the
EXT_mesh_features
extension is to identify "individual things" (like buildings or trees) within a glTF asset. And I could imagine that many glTF assets already do have a structure that reflects this: In many cases, a singlemesh
ormesh.primitive
will be "a building" or "a tree".In rendering engines like CesiumJS, these parts can often no longer be distinguished. Whatever is loaded from the GLB counts as "one thing", and diving into the glTF scene graph- and mesh structures is not necessarily offered on an API level.
It could be useful to introduce a functionality to just automatically assign consecutive IDs to all meshes or mesh primitives that are contained in a glTF asset. There are some obvious degrees of freedom, like
But in the most basic case, and in terms of implementation effort, this could be a really low-hanging fruit. And it would already allow a systematic way of identifying the former elements after the glTF was loaded into the runtime engine.
The text was updated successfully, but these errors were encountered: