Skip to content
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 convenience functions to create instanced models #84

Open
javagl opened this issue Nov 9, 2023 · 6 comments
Open

Consider convenience functions to create instanced models #84

javagl opened this issue Nov 9, 2023 · 6 comments

Comments

@javagl
Copy link
Contributor

javagl commented Nov 9, 2023

There currently is a glbToI3dm command that takes a GLB file and generates an I3DM from that. This I3DM contains a single instance. This is of somewhat limited use, considering that I3DM is now considered a 'legacy' format, and there is no longer any benefit of wrapping a GLB into such an I3DM.

We could consider to create utility functions for creating real instanced models.

(The output should preferably be GLBs with EXT_mesh_gpu_instancing extension, but we could also look at creating I3DM (maybe with URI as payload), if it's considered to be worth the effort)

In terms of implementing the functionality itself, this could be a pretty low-hanging fruit. The ExtInstanceFeaturesDemo.ts already shows that creating such a GLB from a bunch of translations is trivial.

The main degree of freedom is: Where does the instancing information come from?

A pragmatic (and generic) first shot could be to just use some JSON file with information like

{
    translations: [
        [1,2,3],
        [2,3,4],
    },
    rotations: [
        [0,0,0,1],
        [0,1,0,0],
    },
    scales: [
        [1,1,1],
        [2,2,2],
    }
}

Apparently, there are sources for data that could be relevant for creating such instanced models. For example, @bertt mentioned in the forum that opentrees.org could be a source for creating instanced tree models. Other sources of instancing information could be databases with the locations of wind power plants, for example. Maybe there could even be a thin convenience layer that takes longitude/latitude/height information and converts that into the low-level translation/rotation/scale information.

@bertt
Copy link

bertt commented Sep 9, 2024

@javagl
Copy link
Contributor Author

javagl commented Sep 9, 2024

@qwork2010 The required functionality has not (yet) been implemented as part of the 3D Tiles Tools. But you could give the tool that bertt linked to a try

@bertt
Copy link

bertt commented Sep 11, 2024

@qwork2010 use option --use_gpu_instancing, rotation angles must be in columns roll, pitch, yaw

@bertt
Copy link

bertt commented Sep 12, 2024

In I3dm.export you must have the model (glb not I3dm) and model positions and rotations (roll pitch, yaw) in the database table.

@mittermichal
Copy link

postgres is not running or maybe it is blocked by windows firewall

@mittermichal
Copy link

you should ask questions regarding i3dm.export in its issue tracker instead: https://github.com/Geodan/i3dm.export/issues

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants