glTFast
glTFast copied to clipboard
Point Cloud GLTF export issue
Hi,
We try to make a point cloud scanner in Unity.
We use arfoundation-densepointcloud and we export point cloud with gltfast.
Then we try to import gltf point cloud in https://gltf-viewer.donmccurdy.com/ or in https://threejs.org/editor/ but we got error :
THREE.GLTFLoader: Primitive mode unsupported: Points
We we look inside GLTFLoader.js you can see where error is throw :
- Error : https://github.com/mrdoob/three.js/blob/3a76bc7d212557422abe33525d2f3e44f79fb406/examples/js/loaders/GLTFLoader.js#L3318
- WEBGL_CONSTANTS : https://github.com/mrdoob/three.js/blob/3a76bc7d212557422abe33525d2f3e44f79fb406/examples/js/loaders/GLTFLoader.js#L1799
Inside GLTF if we modify :
"meshes": [
{
"name": "Point Cloud",
"primitives": [
{
...
"mode": "Points"
}
]
}
]
by
"meshes": [
{
"name": "Point Cloud",
"primitives": [
{
...
"mode": 0
}
]
}
]
We can open GLTF point cloud in any THREE.JS viewer. Primitive Mode MUST be integer : https://www.khronos.org/registry/glTF/specs/2.0/glTF-2.0.html#_mesh_primitive_mode