Oslandia / py3dtiles

:warning: Project migrated to : https://gitlab.com/py3dtiles/py3dtiles :warning:
https://py3dtiles.org
Other
215 stars 76 forks source link

Wrong transformation or rotation in b3dm export #78

Closed mholthausen closed 4 years ago

mholthausen commented 4 years ago

There seems to be an error in the exporting of a b3dm in the transformation or rotation of the gltf object and the tileset boundingVolume box. I have exported the Polyhedralsurface (in EPSG:4978) which is based on a DalunayTriangles TINZ of theses XYZ points (in EPSG:31468):

4577799, 5809394, 112
4566546, 5809394, 112
4623589, 5809394, 112
4623589, 5837277, 112
4566546, 5837277, 112
4577799, 5837277, 112

The area should be a "flat plane" at the height of 112 meters. But the resulting tileset has a rotation in the boundingVolume box and a boundingVolume extent that does not include all parts of the gltf object.

let boundingSphere = tileset.boundingSphere;
let cartographic = Cartographic.fromCartesian(boundingSphere.center);

let surface = Cartesian3.fromRadians(cartographic.longitude, cartographic.latitude, 0.0);
let matrix = Transforms.eastNorthUpToFixedFrame(surface);
tileset.root.transform = matrix;

Executing the above code on the tileset in the Cesium viewer fixes the rotation of the boundingVolume box, but the gltf object is tilted. When I view the gltf in a gltf Viewer I see also a tilted plane (note the attached scrrenshots).

tilted_boundingVolume

tilted_plane

gltf_viewer

autra commented 4 years ago

Hi @mholthausen!

I have exported the Polyhedralsurface (in EPSG:4978)

what is exactly the code / command you used to export this surface?

Can you attach a screenshot of the plane before changing the tileset matrix in cesium?

Thanks

delhomer commented 4 years ago

Moved to https://gitlab.com/Oslandia/py3dtiles/-/issues/78