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

Geolocated GLTF file is 90 degrees East of where it should be #7353

Open
p3t3c opened this issue Dec 5, 2024 · 0 comments
Open

Geolocated GLTF file is 90 degrees East of where it should be #7353

p3t3c opened this issue Dec 5, 2024 · 0 comments

Comments

@p3t3c
Copy link

p3t3c commented Dec 5, 2024

Hi,

First off, great project. Very impressed with what's been achieved.

I've been working on creating geo located GLTF files after successfully viewing them with a simple Cesium viewer I've been trying to display them with TerriaJS. The objects appear at the expected scale and orientation but are positioned incorrectly, 90 degreees east of where they should be.

I have some simple code to illustrate the problem:

Full code is here : https://github.com/p3t3c/geolocated-gltf/tree/main

GLTF is created with PyVista as such :

    earth_radius_metres = 6378237.0
    big_red_box = pv.Cube(center=(earth_radius_metres, 0, 0), x_length=500, y_length=2000, z_length=500, clean=False)

    pl = pv.Plotter()
    _ = pl.add_mesh(big_red_box, color='red', smooth_shading=True, show_scalar_bar=False)
    pl.export_gltf('geobox.gltf')

So should be on the surfaces at 0 latitude, 0 longitude. Oriented east/west.

Displaying the object in a simple cesium viewer which shows how the GLTF is loaded.

Problem occurs when loading the same file into TerriaJS.

The model can be loaded as GLTF by hosting on localhost or local server and using Upload -> Add Web Data -> [Step 1] GLTF -> my URL
It is possible to re-create the issue if I package the GLTF to GLB and upload it to map.terria.io

Object appears at 0N, 90E

Given Cesium correctly locates the objects it appears Terria might be applying a transform of some kind.

Version 0.2.3 running from the docker container.

If there is anything further needed to help understand the problem, please let me know.

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

1 participant