jupyter-widgets / pythreejs

A Jupyter - Three.js bridge
https://pythreejs.readthedocs.io
Other
936 stars 187 forks source link

Is it possible to animate vertex points on a line with keyframe tracks? #242

Closed subTropic closed 5 years ago

subTropic commented 5 years ago

I want to animate a line by setting the position of each vertex directly, i.e not by animating the transform of the parent object.

I have tried creating a line using LineSegementsGeometry and animating it's 'positions' via keyframe tracks. I have also tried creating a line using BufferGeometry and animating it's 'position' buffer attribute via keyframe tracks, neither of these approaches seem to work, the line vertex positions do not animate. Animating position, rotation etc on the parent object with keyframe tracks works fine.

Could someone provide a simple example of animating two vertex points on a line with keyframe tracks?

vidartf commented 5 years ago

The way to animate vertex positions would be using morph targets. Sadly, this is not yet supported for lines in threejs. See upstream issue: https://github.com/mrdoob/three.js/issues/2875.

subTropic commented 5 years ago

Got it, thanks.