-
-
Notifications
You must be signed in to change notification settings - Fork 304
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
[Potentially useful Info] Google 3D cities available as OGC 3D tiles #279
Comments
Proof-of-concept from @OmarShehata on twitter.
|
This would be super useful for a lot of people! Some more details from my process if it helps:
|
Thanks to you I was able to create my own method of grabbing gmaps 3d tiles. Downloading the tiles
meshDownloader.cs using System.Net;
using UnityEngine;
//attach this script to the Cesium3DTileset object
public class meshDownloader : MonoBehaviour
{
public string outputFolder = @"D:\temp\maps\";
public void idk()
{
// var baseObj = GameObject.Find("Cesium3DTileset");
var baseObj = gameObject;
int counter = 0;
//if outputFolder doesnt end with a backslash, add one,
if (outputFolder[outputFolder.Length-1] != '\\')
{
outputFolder += @"\";
}
for (int i = 0; i < baseObj.transform.childCount; i++)
{
var tile = baseObj.transform.GetChild(i).gameObject;
if (tile.activeSelf && tile.name.Contains(".glb"))
{
//download
using (var client = new WebClient())
{
Debug.Log(counter+".glb");
client.DownloadFile(tile.name, outputFolder+counter+".glb");
counter++;
}
}
}
}
} meshDownloaderButton.cs using UnityEditor;
using UnityEngine;
[CustomEditor(typeof(meshDownloader))]
public class meshDownloaderButton : Editor
{
public override void OnInspectorGUI()
{
DrawDefaultInspector();
var myScript = (meshDownloader)target;
if (GUILayout.Button("download"))
{
myScript.idk();
}
}
}
Merging the tilesYou can merge the GLB files to 1 file with glTF Transform https://gltf-transform.dev/
Moving the tiles to the center of the scene
Rotating the objects so they're face-upExample coordinates: 53.496306, 9.9503333
|
One problem I'm still trying to solve is these gaps: My theory is that these gaps are there because the meshes in the glb files are so far from the center of the scene. Blender uses floating point values to store positions, so the further from the center of the scene the meshes are, the less precise their position is stored. |
Just crawling through my list of open threads, sorry for the ping. @OmarShehata there are various ways to find that matrix-transform:
@t0stiman Floating-point precision errors result when the whole matrix transform pipeline is not applied in one go - eg your tiles are far from the origin, and the camera is far as well to. In the local coordinate system of each tile, these precision errors are not present. You can try to apply the same matrix-transform that would move the whole tileset closer to the origin. Note for blender users willing to download a sample of 3d-tiles data, the BLOSM python implementation is a great way to do it - @vvoovv just implemented custom 3d-tileset tileset.json endpoint support - and Cesium Ion introduced Offline Clips of 3D Tiles |
Probably useful at some point, Google just released all its 2500 cities datasets as OGC/Cesium 3D-tiles at its GoogleIO-May2023 conference. The 3D-tiles standard is made to stream datasets - rather than download offline/merged 3D models - and is compatible through cesium libs with UnrealEngine, Unity, CesiumJS, Nvidia OmniVerse, deck-gl etc.
Note:
CesiumJS Demo | google release post | cesium blog post
The text was updated successfully, but these errors were encountered: