GLTF scenes to 3D tiles

It looks like when you loading models directly into Cesium JS, the instancing (e.g. ModelInstanceCollection) function that existed previously was marked private around version 0.96.

It sounds like i3dm may be the way to go for these models that I will be instancing. I’ve seen some of the stuff Brett has put out there, it’s great. I’ll also try the KMZ approach as I have read in a few places that Cesium Ion would notice the same model being used and using instancing as well. Worth a try as having my pipeline spit out a KMZ file after an edit is pretty straight forward.

As for the other things in my scene, here is a summary of my app. I’m making a golf simulation app that connects up to a launch monitor (sensor that measures golf balls when you hit them). I’ve created a physics engine that models the flight path and have tied in a method for handling collisions in 3D space (nearly got all that part working in Cesium, bit more things to tweak). From there I have started building an AI/ML data pipeline that can recreate 3D models of golf courses around the world using various types of information (e.g. for terrain it will look for lidar data, then DEM, and if DEM is too low res, it will look at the course layout or generate a layout from imagery and AI then based on previous courses that have been created, create an estimate of what the terrain looks like). From there I have a collection of a few hundred different models for trees, buildings, vehicles, and a few other things you would expect to see near a golf course. A single course would only use about 50 of these models on average (e.g. different trees in different areas). In the 3D tiles I would trees, buildings, and things like cars and other static assets. In addition to that I have the following:

  • A single 3D model of a golf flag that will move around throughout the game, including moving out of the way when needed. It has an animation in it to flap with the wind. This model is about 150kb.
  • Several polygon primitives that will overlap bodies of water and streams. I managed to get the water material and animation working on any polygon primitive. I am also experimenting with having a second polygon underneath that has an image of a reflection to try and fake it a bit more since we don’t have true reflections in Cesium JS. I’m still experimenting with this. I’ve also be trying to make a water GTLF model on a flat plane that I could reuse, but getting water animations from blender to GLTF to work is a pain and likely why the water material is animating a normal image for this.
  • a model of a golf ball that will of course be doing a lot of moving around. This is less than a KB in size.
  • I also have vector tiles that breaks up all the areas of the course (fairway, greens, out of bounds…) that I can easily use to identify what type of ground the ball impacted with so I can calculate the correct type of bounce or take the ball out of play. I will also need to do collision detection with models and have seen some threads on how to achieve this.
  • I’m also playing around with some other ideas, like using flat images with wall polygons (or as a GLTF plane) as a simple model for certain things, like laying a retaining wall image on the side of terrain since a raster tile layer wouldn’t stretch nicely over that.

This is primarily a fun side project (when I’m not tearing my hair out, lol). I’m purposely trying to get this to work in a web app as I want the app to be able to run on low end devices across multiple platforms. Since I already have a physics engine that is optimized for this scenario, all I really need is a place to render everything. I could possibly do all of this in babylon.js or three.js, or possibly even maplibre (I have a ton of experience with that) but wanted to have a crack at getting this working in Cesium first. I’ve used Cesium many times over the years but not as regularly as other platforms, mainly due to 2D map scenarios being easier to achieve on other maps. I have been following Cesium since its AGI days and had many meetings with Patrick back then.