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 · 8 comments
Open

Consider convenience functions to create instanced models #84

javagl opened this issue Nov 9, 2023 · 8 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

@qwork2010
Copy link

@bertt
Hello!
Thank you very much for your response!I have already obtained the Instanced 3D Model of the windmill (i3dm). Is there any way to modify the pitch angle in the vertical direction?

@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.

@qwork2010
Copy link

@bertt
Hello !
On the path“ https://github.com/Geodan/i3dm.export ”I downloaded the program.

1b

1] Use pre-built binaries from release

1

Run the program i3dm.xport.exe, the software crashes.

2] Use . NET Tool
Prerequisite: .NET 8.0 SDK is installed https://dotnet.microsoft.com/download/dotnet/8.0
use. NET tool, the result information shows an error.

2
3
4

May I ask how to solve this problem?

@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

4 participants