How do I animate the drawing of a line?

The tool to use is : MeshBuilder - Babylon.js Documentation
Like in 3js, the number of points set will be the maximum number. Think to build your line mesh as updatable
Then to “animate” or morph the lines, just use the parameter instance and simply change the points coordinates according to your need.
Parametric Shapes - Babylon.js Documentation
Create Parametric Shapes - Babylon.js Documentation

If you need something more versatile (different colors, segments, etc) still drawn in one draw call, then use the LineSystem instead : MeshBuilder - Babylon.js Documentation
that works exactly like the line mesh Create Parametric Shapes - Babylon.js Documentation

4 Likes