Hi everyone,
I’m working on creating educational historical content on YouTube and use Unreal Engine 5.4 to visualize various locations. Since I often need to change locations, I require a convenient and quick method to import data with coordinates while preserving their position and size.
Currently, I use QGIS to prepare the data and have the following results:
- Using the qgis2threejs plugin for QGIS, I managed to create glTF files, which I convert to 3D Tiles in Cesium Ion. This approach allows me to import models into Unreal Engine, but the problem is that I cannot retain global coordinates, forcing me to manually adjust the position either in Cesium or Unreal Engine, which is not very convenient.
- I tried using a KML file since it retains coordinates, as seen in the Cesium preview. However, when I attempt to convert the KML to 3D Tiles, I get the message: “Only KML/KMZ files with models are supported.” I’m stuck here and don’t know how to add 3D models to the KML.
My questions are:
- Is there a convenient way to create KML files with 3D models (possibly via QGIS) so that I can convert them to 3D Tiles with all necessary coordinates and use them in Unreal Engine?
- Alternatively, is there a more optimal approach for importing data with coordinates into Unreal Engine while preserving the coordinates?
I might need terrain data, but often a flat plane will suffice. I understand that my approach might be overly complex and that a simpler method might involve creating a base of countries using glTF files and then inserting them into the project. However, I believe that building the right workflow can make this process easier and faster.
I would appreciate any advice or recommendations.
Thank you,
Hi @aborigen19961202, welcome to the community!
I don’t have a lot of experience exporting data from QGIS into Cesium for Unreal, so I don’t have any quick and easy answers for you. I think this is a really good question, though, and having a high-quality path from QGIS to Cesium would be valuable to a lot of people.
Exporting KML isn’t likely to work too well, unfortunately. CesiumJS can render KML directly (that is, without converting it to 3D Tiles), but Cesium for Unreal currently cannot. The KML → 3D Tiles support in Cesium ion is about converting the 3D models embedded in a KML file to 3D Tiles, rather than “rendering” the KML elements as 3D Tiles.
Do you know what cooridnate system the qgis2threejs plugin uses when exporting a glTF model? Is it just the projected map coordinates (e.g. longitude/latitude/height)? Or does it convert to a Cartesian coordinate system (e.g. ECEF) centered on the data? If it’s the former, the glTF itself will have to be transformed, which is possible but tricky. If it’s the latter, though, importing it may be a simple matter of using a CesiumGlobeAnchor component in Cesium for Unreal to play the local origin at the right place in the world.
Hi @aborigen19961202 and @Kevin_Ring. Thanks for starting this conversation and putting this issue on the table. To summarise, my problem is exactly the same as @aborigen19961202 and over the past few weeks I’ve tried several workflows with Qgis (GeoJson to KML, SHP to KML, etc) with no success. I also tried some code on GitHub (GitHub - fanvanzh/3dtiles: The fastest tools for 3dtiles convert in the world!) but it didn’t work either. My ultimate goal is to render GIS information (mainly from shapefiles) in Unreal using the Cesium plugin.
Really appreciate if you can mention any advice on this topic. Thanks in advance.
Hi @jmtorres322, welcome to the community!
Have you tried the qgis2threejs plugin that was mentioned above? While I don’t have first-hand experience with it, something like that seems like a viable option. Unfortunately we just don’t have an easy, out-of-the-box solution for this right now.
Depending on what type of GIS data you’re concerned with, it might not be too hard to do things manually. For example, if your GIS data is just a bunch of points, you can probably export them to GeoJSON, parse that GeoJSON using Unreal’s JSON support, and create an InstancedStaticMesh to put a model at every point. Methods on the CesiumGeoreference will help you convert geospatial coordinates to Unreal world coordinates during this process.
If you need to render lines or polygons draped on terrain, a good option there is to rasterize your GIS data and use a raster overlay. For example, you can import shapefiles, GeoJSON, etc. into Geoserver, style it with Geoserver SLD language, and then render it draped over terrain in Cesium for Unreal by using a CesiumWebMapServiceRasterOverlay attached to the Cesium3DTileset.
Hi Kevin. Thanks a lot for your support. All your recommendations worked well for me.