spite / THREE.MeshLine

Mesh replacement for THREE.Line
MIT License
2.14k stars 381 forks source link

Implement dasharray and dashoffset params #50

Closed Jeremboo closed 6 years ago

Jeremboo commented 6 years ago

Hi,

I have implemented two new parameters for the MeshLineMaterial to animate the mesh lines like we can do with the SVG strokes (see: SVG line animation works)

I also added in the main demo (demo/js/main.js) GUI parameters dashArray and animateDashOffset to manipulate and test them.

Finally, I updated the README.md to define the new parameters and remove the Support for dashArray of the TODO list.

Jeremboo commented 6 years ago

I added another parameter: dashratio.

With this parameter, you can manage the ratio between the dash and the space. This is only useful when the dasharray is set.

Near to 0 -> the dash is longer than the space. Near to 1 -> the space is longer than the dash. By default, it is set to 0.5.

danyim commented 6 years ago

I would love to have this feature be a part of this library. Can we get this reviewed and merged?

Thank you for contributing to the development of this!

Jeremboo commented 6 years ago

I made some examples on codepen during the codevember period:

dasharray and dashoffset permit to have good animation approach.

danyim commented 6 years ago

@spite @Jared-Sprague Could we merge this in?

Jared-Sprague commented 6 years ago

@Jeremboo @danyim I don't have write access to this repo. I would recommend tweeting at thespite

Jeremboo commented 6 years ago

I sent a private message yesterday :) Thank a lot !

spite commented 6 years ago

Sorry it took such a long time to review and merge. Great work! Thanks!