CesiumGS / cesium

An open-source JavaScript library for world-class 3D globes and maps :earth_americas:
https://cesium.com/cesiumjs/
Apache License 2.0
12.91k stars 3.48k forks source link

`TimeDynamicPointCloud` - add support for glTF / GLB #12181

Open lilleyse opened 1 month ago

lilleyse commented 1 month ago

Feature

TimeDynamicPointCloud only supports .pnts files but should be updated to support glTF / GLB now that .pnts is deprecated.

javagl commented 5 days ago

Nearly off-topic:

It always struck me as a bit odd that the time dynamic point cloud is just a sequence of PNTS files. One could generalize that to glTF. But glTF itself already contains some interesting animation capabilities.

In fact, morph targets can be defined for the POSITION attribute, but also the COLOR_0 attribute. Unfortunately, from all the viewers I tested, only the official sample viewer properly handles morphed COLOR_0 attribute:

NotReallyCesium AnimatedPointCloud

(EDIT: I just noticed that https://gltf-viewer.donmccurdy.com/ does display it. It still reports errors in the validation, because it uses a version of the validator that is older than https://github.com/KhronosGroup/glTF-Validator/pull/240 , where the validation of "indexed attributes" like COLOR_0 has been fixed, but the model is still displayed properly)

_animatedPointCloud0001.zip

(I know, I should be working right now 😟 )

javagl commented 1 day ago

... and with Perlin noise positions, this actually looks kinda cool 😎

NotReallyCesium AnimatedPointCloud Again

Coincidentally, the GIF and the glTF have roughly the same size...

_animatedPointCloud0002.zip