Hi,
I’m exploring alternatives to the Cesium Unity ellipsoid (world globe terrain) within this Godot integration. My current setup uses custom 3D tiles (not Cesium Ion assets), and I’m interested in implementing a smooth ellipsoid terrain model similar to what Cesium Unity provides, especially for realistic global visualization without relying on Cesium World Terrain.
Are there any recommended approaches or existing solutions within the 3D Tiles for Godot framework to achieve a smooth ellipsoid terrain model? Any guidance on adapting the plugin or integrating a custom ellipsoid provider would be greatly appreciated.
Thx
@Manju_nath Most of the ellipsoid terrain loader is implemented in Cesium Native (which 3D Tiles for Godot relies on), so it should be pretty simple to implement it in Godot. Looks like you’ll want to add some code somewhere around here to set m_activeTileset to the result of EllipsoidTilesetLoader::createTileset. That might be all it takes!
1 Like
Thanks a lot,
I will try this and revert.
Hi,
I have implemented method for cesium ellipsoid and used a raster overlay,
Thx
@Manju_nath
Do you have examples to show what changes in script, either GDScript or C++. Appreciate.
Add the code block in load_tileset inside
cesium_godot/Models/CesiumGDTileset.cpp
file.
// Add the FromEllipsoid case
else if (this->m_selectedDataSource == CesiumDataSource::FromEllipsoid) {
this->m_activeTileset = Cesium3DTilesSelection::EllipsoidTilesetLoader::createTileset(
this->create_tileset_externals(),
options
);
}
//Else this is coming from a URL
also need to add bind method, FromEllipsoid in CesiumDataSource header and update the url property visibility section aswell.
Thx
update: EllipsoidTilesetLoader.h is located here in 3D-Tiles-For-Godot/cesium_godot/native/Cesium3DTilesSelection/include/Cesium3DTilesSelection/EllipsoidTilesetLoader.h
Thank you, I will feedback to GitHub. Appreciate active contribution to Cesium4Godot
1 Like
@azrogers
i was able to resolve the issue with ellipsoid, now it works 
**
Issue**: the apply_gltf_up_axis_transform function in CesiumModelLoader.cpp here:
if (gltfUpAxisValue == static_cast(CesiumGeometry::Axis::Z)) {
// No transform required
}
return rootTransform;
Ion terrain: Likely has gltfUpAxis = 1 (Y-axis up) → gets Y_UP_TO_Z_UP transform applied
Ellipsoid terrain: Has gltfUpAxis = 2 (Z-axis up) → no transform applied because it’s already Z-up
The Problem: Even though ellipsoid terrain claims to be Z-up (gltfUpAxis = 2), it actually needs the Y_UP_TO_Z_UP rotation to align properly. This suggests that the ellipsoid terrain generator is incorrectly setting gltfUpAxis = 2 when it should be gltfUpAxis = 1.
so when the tile is applied with apply_gltf_up_axis_transform in GodotPrepareRenderResources.cpp here the identity matrix remains unchanged
For now it can be resolved by suggested fix from my earlier post and then updating the prepareInMainThread section in GodotPrepareRenderResources.cpp here :
void* GodotPrepareRenderResources::prepareInMainThread(Tile& tile, void* pLoadThreadResult){const Cesium3DTilesSelection::TileContent& content = tile.getContent();const Cesium3DTilesSelection::TileRenderContent* pRenderContent = content.getRenderContent();
if (pRenderContent == nullptr) {
return pLoadThreadResult;
}
const CesiumGltf::Model& model = pRenderContent->getModel();
// Apply the transform if any
Cesium3DTile* instance = reinterpret_cast<Cesium3DTile*>(pLoadThreadResult);
// glm::dmat4 instanceXform = CesiumMathUtils::to_glm_mat4(instance->get_transform());
bool isWorldTerrainEllipsoid = (this->m_tileset->get_data_source() == CesiumDataSource::FromEllipsoid);
glm::dmat4 tileTransform = tile.getTransform();
tileTransform = CesiumGDModelLoader::apply_rtc_center(model, tileTransform);
tileTransform = CesiumGDModelLoader::apply_gltf_up_axis_transform(model, tileTransform);
// Then apply the z up
glm::dvec3 position = glm::dvec3(CesiumMathUtils::ecef_to_engine(tileTransform[3]));
instance->set_original_position(instance->get_original_position() + position);
if(isWorldTerrainEllipsoid){
// add the -90° X-axis rotation that ellipsoid terrain is missing
Transform3D currentTransform = instance->get_transform();
// create -90-degree rotation around X-axis (same as Ion terrain)
Basis ellipsoidRotation = Basis(Vector3(1, 0, 0), Math::deg_to_rad(-90.0));
// apply the rotation to the current basis
currentTransform.basis = ellipsoidRotation * currentTransform.basis;
// set the corrected transform
instance->set_transform(currentTransform);
}
return pLoadThreadResult;
}
Thx
1 Like