Just to place my problem into context, I am using 3DCityDB and am exploring why building vertices in WGS84 do not show up in GLTF format when viewed in Cesium (through the included 3d-web-map-client) but do nicely in KML. EPSG:3857 vertices show up fine in both KML and GLTF.
I am looking to explore this problem from both the Cesium and 3DCityDB side and figure out if it’s a problem with 3DCityDB writing of GLTFs or a limitation of GLTFs itself. I’m taking shots in the dark on why the issue is occurring, so I’m looking for some help in understanding the problem.
I do see that there is no Cesium_RTC extension included in GLTFs, which makes sense as the coordinates are relative to 0 lat, 0 long, not model center. Is there something necessary missing in the sample GLTF to permit WGS84 vertices? As an alternative, are the coordinates in GLTF assumed to be ECEF (if not described otherwise) and so would converting the db to ECEF likely fix the issue assuming 3DCityDB remains unchanged?
Thanks in advance!
Below is a sample GLTF as exported by 3DCityDB which should contain a singular building as well as the JS for the 3DCityDB viewer:
{
“accessors”: {
“accessor_16”: {
“bufferView”: “bufferView_22”,
“byteOffset”: 0,
“byteStride”: 0,
“componentType”: 5123,
“count”: 54,
“type”: “SCALAR”
},
“accessor_18”: {
“bufferView”: “bufferView_23”,
“byteOffset”: 0,
“byteStride”: 12,
“componentType”: 5126,
“count”: 46,
“max”: [
0.0001912,
0.0001174,
7.5
],
“min”: [
0,
-2e-07,
0
],
“type”: “VEC3”
},
“accessor_20”: {
“bufferView”: “bufferView_23”,
“byteOffset”: 552,
“byteStride”: 12,
“componentType”: 5126,
“count”: 46,
“max”: [
1,
0.999999,
1
],
“min”: [
-0.999997,
-1,
0
],
“type”: “VEC3”
}
},
“animations”: {},
“asset”: {
“generator”: “collada2gltf@d78daf1e7950e6c22fe6bec1d07965e8a302e90d”,
“premultipliedAlpha”: true,
“profile”: {
“api”: “WebGL”,
“version”: “1.0.2”
},
“version”: 1
},
“bufferViews”: {
“bufferView_22”: {
“buffer”: “UUID_9fet8p2i-bfoi-6hyu-dz01-bvntblxrubra”,
“byteLength”: 108,
“byteOffset”: 0,
“target”: 34963
},
“bufferView_23”: {
“buffer”: “UUID_9fet8p2i-bfoi-6hyu-dz01-bvntblxrubra”,
“byteLength”: 1104,
“byteOffset”: 108,
“target”: 34962
}
},
“buffers”: {
“UUID_9fet8p2i-bfoi-6hyu-dz01-bvntblxrubra”: {
“byteLength”: 1212,
“type”: “arraybuffer”,
“uri”: “data:application/octet-stream;base64,AAABAAIAAwAEAAUABgAHAAgACQAKAAsADAANAA4ADwAQABEAEgATABQAFQAWABcAGAAZABoAGwAcAB0AHgAeAB8AIAAhACEAIgAiACMAJAAlACUAJgAmACcAKAApACkAKgAqACsALAAtAC0AsA+hNKU09jgAAPBAAAAAAAAAAAAAAPBAVCxIOZW/VrQAAPBAsA+hNKU09jgAAPBAVCxIOZW/VrQAAPBA3HxIOZWT9TgAAPBAAAAAAAAAAAAAAPBAAAAAAAAAAAAAAAAAVCxIOZW/VrQAAPBAAAAAAAAAAAAAAAAAVCxIOZW/VrQAAAAAVCxIOZW/VrQAAPBAVCxIOZW/VrQAAPBAVCxIOZW/VrQAAAAA3HxIOZWT9TgAAPBAVCxIOZW/VrQAAAAA3HxIOZWT9TgAAAAA3HxIOZWT9TgAAPBA3HxIOZWT9TgAAPBA3HxIOZWT9TgAAAAAsA+hNKU09jgAAPBA3HxIOZWT9TgAAAAAsA+hNKU09jgAAAAAsA+hNKU09jgAAPBAsA+hNKU09jgAAPBAsA+hNKU09jgAAAAAAAAAAAAAAAAAAPBAsA+hNKU09jgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAPBAAAAAAAAAAAAAAPBAVCxIOZW/VrQAAPBAAAAAAAAAAAAAAPBAVCxIOZW/VrQAAPBAVCxIOZW/VrQAAPBA3HxIOZWT9TgAAPBAVCxIOZW/VrQAAPBA3HxIOZWT9TgAAPBA3HxIOZWT9TgAAPBAsA+hNKU09jgAAPBA3HxIOZWT9TgAAPBAsA+hNKU09jgAAPBAsA+hNKU09jgAAPBAAAAAAAAAAAAAAPBAsA+hNKU09jgAAPBAAAAAAAAAAAAAAPBAAAAAAAAAAAAAAIA/AAAAAAAAAAAAAIA/AAAAAAAAAAAAAIA/AAAAAAAAAAAAAIA/AAAAAAAAAAAAAIA/AAAAAAAAAAAAAIA/v82Huvj/f78AAAAAv82Huvj/f78AAAAAv82Huvj/f78AAAAAv82Huvj/f78AAAAAv82Huvj/f78AAAAAv82Huvj/f78AAAAAxf9/P7C1LbsAAAAAxf9/P7C1LbsAAAAAxf9/P7C1LbsAAAAAxf9/P7C1LbsAAAAAxf9/P7C1LbsAAAAAxf9/P7C1LbsAAAAAuMPLOuz/fz8AAAAAuMPLOuz/fz8AAAAAuMPLOuz/fz8AAAAAuMPLOuz/fz8AAAAAuMPLOuz/fz8AAAAAuMPLOuz/fz8AAAAAyv9/v3jcJjsAAAAAyv9/v3jcJjsAAAAAyv9/v3jcJjsAAAAAyv9/v3jcJjsAAAAAyv9/v3jcJjsAAAAAyv9/v3jcJjsAAAAAAACAPwAAAAAAAAAAAACAPwAAAAAAAAAAAACAPwAAAAAAAAAAAACAPwAAAAAAAAAAAACAPwAAAAAAAAAAAACAPwAAAAAAAAAAAACAPwAAAAAAAAAAAACAPwAAAAAAAAAAAACAPwAAAAAAAAAAAACAPwAAAAAAAAAAAACAPwAAAAAAAAAAAACAPwAAAAAAAAAAAACAPwAAAAAAAAAAAACAPwAAAAAAAAAAAACAPwAAAAAAAAAAAACAPwAAAAAAAAAA”
}
},
“materials”: {
“default_ai_0.2_sh_0.2_tr_0.0_dc_r_0.8_g_0.8_b_0.8_sc_r_1.0_g_1.0_b_1.0_ec_r_0.0_g_0.0_b_0_eff”: {
“name”: “default_ai_0.2_sh_0.2_tr_0.0_dc_r_0.8_g_0.8_b_0.8_sc_r_1.0_g_1.0_b_1.0_ec_r_0.0_g_0.0_b_0_mat”,
“technique”: “technique0”,
“values”: {
“diffuse”: [
0.8,
0.8,
0.8,
1
],
“emission”: [
0,
0,
0,
1
]
}
}
},
“meshes”: {
“geometry0”: {
“name”: “geometry0”,
“primitives”: [
{
“attributes”: {
“NORMAL”: “accessor_20”,
“POSITION”: “accessor_18”
},
“indices”: “accessor_16”,
“material”: “default_ai_0.2_sh_0.2_tr_0.0_dc_r_0.8_g_0.8_b_0.8_sc_r_1.0_g_1.0_b_1.0_ec_r_0.0_g_0.0_b_0_eff”,
“mode”: 4
}
]
}
},
“nodes”: {
“node_0”: {
“children”: ,
“matrix”: [
1,
0,
0,
0,
0,
1,
0,
0,
0,
0,
1,
0,
0,
0,
0,
1
],
“meshes”: [
“geometry0”
],
“name”: “”
},
“node_1”: {
“children”: [
“node_0”
],
“matrix”: [
1,
0,
0,
0,
0,
0,
-1,
0,
0,
1,
0,
0,
0,
0,
0,
1
],
“name”: “Y_UP_Transform”
}
},
“programs”: {
“program_0”: {
“attributes”: [
“a_normal”,
“a_position”
],
“fragmentShader”: “UUID_9fet8p2i-bfoi-6hyu-dz01-bvntblxrubra0FS”,
“vertexShader”: “UUID_9fet8p2i-bfoi-6hyu-dz01-bvntblxrubra0VS”
}
},
“scene”: “defaultScene”,
“scenes”: {
“defaultScene”: {
“nodes”: [
“node_1”
]
}
},
“shaders”: {
“UUID_9fet8p2i-bfoi-6hyu-dz01-bvntblxrubra0FS”: {
“type”: 35632,
“uri”: “data:text/plain;base64,cHJlY2lzaW9uIGhpZ2hwIGZsb2F0Owp2YXJ5aW5nIHZlYzMgdl9ub3JtYWw7CnVuaWZvcm0gdmVjNCB1X2RpZmZ1c2U7CnVuaWZvcm0gdmVjNCB1X2VtaXNzaW9uOwp2b2lkIG1haW4odm9pZCkgewp2ZWMzIG5vcm1hbCA9IG5vcm1hbGl6ZSh2X25vcm1hbCk7CnZlYzQgY29sb3IgPSB2ZWM0KDAuLCAwLiwgMC4sIDAuKTsKdmVjNCBkaWZmdXNlID0gdmVjNCgwLiwgMC4sIDAuLCAxLik7CnZlYzQgZW1pc3Npb247CmRpZmZ1c2UgPSB1X2RpZmZ1c2U7CmVtaXNzaW9uID0gdV9lbWlzc2lvbjsKZGlmZnVzZS54eXogKj0gbWF4KGRvdChub3JtYWwsdmVjMygwLiwwLiwxLikpLCAwLik7CmNvbG9yLnh5eiArPSBkaWZmdXNlLnh5ejsKY29sb3IueHl6ICs9IGVtaXNzaW9uLnh5ejsKY29sb3IgPSB2ZWM0KGNvbG9yLnJnYiAqIGRpZmZ1c2UuYSwgZGlmZnVzZS5hKTsKZ2xfRnJhZ0NvbG9yID0gY29sb3I7Cn0K”
},
“UUID_9fet8p2i-bfoi-6hyu-dz01-bvntblxrubra0VS”: {
“type”: 35633,
“uri”: “data:text/plain;base64,cHJlY2lzaW9uIGhpZ2hwIGZsb2F0OwphdHRyaWJ1dGUgdmVjMyBhX3Bvc2l0aW9uOwphdHRyaWJ1dGUgdmVjMyBhX25vcm1hbDsKdmFyeWluZyB2ZWMzIHZfbm9ybWFsOwp1bmlmb3JtIG1hdDMgdV9ub3JtYWxNYXRyaXg7CnVuaWZvcm0gbWF0NCB1X21vZGVsVmlld01hdHJpeDsKdW5pZm9ybSBtYXQ0IHVfcHJvamVjdGlvbk1hdHJpeDsKdm9pZCBtYWluKHZvaWQpIHsKdmVjNCBwb3MgPSB1X21vZGVsVmlld01hdHJpeCAqIHZlYzQoYV9wb3NpdGlvbiwxLjApOwp2X25vcm1hbCA9IHVfbm9ybWFsTWF0cml4ICogYV9ub3JtYWw7CmdsX1Bvc2l0aW9uID0gdV9wcm9qZWN0aW9uTWF0cml4ICogcG9zOwp9Cg==”
}
},
“skins”: {},
“techniques”: {
“technique0”: {
“attributes”: {
“a_normal”: “normal”,
“a_position”: “position”
},
“parameters”: {
“diffuse”: {
“type”: 35666
},
“emission”: {
“type”: 35666
},
“modelViewMatrix”: {
“semantic”: “MODELVIEW”,
“type”: 35676
},
“normal”: {
“semantic”: “NORMAL”,
“type”: 35665
},
“normalMatrix”: {
“semantic”: “MODELVIEWINVERSETRANSPOSE”,
“type”: 35675
},
“position”: {
“semantic”: “POSITION”,
“type”: 35665
},
“projectionMatrix”: {
“semantic”: “PROJECTION”,
“type”: 35676
}
},
“program”: “program_0”,
“states”: {
“enable”: [
2929,
2884
]
},
“uniforms”: {
“u_diffuse”: “diffuse”,
“u_emission”: “emission”,
“u_modelViewMatrix”: “modelViewMatrix”,
“u_normalMatrix”: “normalMatrix”,
“u_projectionMatrix”: “projectionMatrix”
}
}
}
}
``
/*
* 3DCityDB-Web-Map-Client
* http://www.3dcitydb.org/