1. A concise explanation of the problem you're experiencing.
I have an datasource with 3D building data from an postgis databse. The data is stored in ETRS89 UTM32N (mainly west germany) reference system. This building data has to be shown on the globe.
I have written a exporter that transform those data (with use of postgis function ST_Transform) to WGS84 (height is stored as height about ground). So each vertex has an lat, lon and alt for x,y, and z.
Because i read somewhere that cesium works with earthcentred coordinates, i than transformed those coordinates to cartesian coordinates. (ECEF). I allready checked the results for some sample points with this online tool: http://www.apsalin.com/convert-geodetic-to-cartesian.aspx. Furthermore the model looks good with all gltf viewers i found (this https://gltf-viewer.donmccurdy.com/ and some others) and the gltfValidator (http://github.khronos.org/glTF-Validator/) says everything is fine.
So i think the model is almost fine.
I tried to load the model into cesium, but it does not appear. I thought that i have to load the model into earth center so that the model internal values can effect, but that does not changed the non display.
After some searching in this forum i found that models, that are placed under ground are not rendered. I asume that my model does not show up, because its placed in earths core.
Next i tried to convert the model, so that its vertices are all related to the ground center point of the buidling. I think now i have a model that has it's local coordinate system and the building is placed on top the (0,0,0) coordinate. Again validator and viewer say everthing is fine.
When i try to load this model its shown, but not at the expected location. I thought it must now be shown like some of the sample models, but they don't. Model appears kilometers above ground. But scince the values in the vertices are smal (building size max 100m) i can't think of, why.
Additional Question how to use this forum:
I saw questions with appended files, but i can't see any add file button here. What to do to add an file here?
2. A minimal code example. If you've found a bug, this helps us reproduce and repair it.
// position to place building on ground at lat:0 lon:0
let modelPosCartesian3 = Cesium.Cartesian3.fromDegrees(0, 0, 0);
// Create modelmatrix to move model to place
let modelMatrix = Cesium.Transforms.eastNorthUpToFixedFrame(modelPosCartesian3);
let modelFromGltf = Cesium.Model.fromGltf({
url: modelFilePath,
modelMatrix: modelMatrix,
scale: 10000,
debugShowBoundingVolume: true,
debugWireframe: true
});
let modelFromGltfReference = SAFE_globe.viewer.scene.primitives.add(modelFromGltf);
3. Context. Why do you need to do this? We might know a better way to accomplish your goal.
4. The Cesium version you're using, your operating system and browser.
Tried with Cesion 1.50 and 1.52