Table of Contents

WebGL2Fundamentals.org

Fix, Fork, Contribute

How to Achieve Moving Line with Trail Effects

Question:

What's the idea of drawing such lines in the following demo? Drawing a single line with trailing effects might be simple. But those lines are also turning their directions.

http://uber.github.io/deck.gl/#/examples/custom-layers/trip-routes

Answer:

you can pass in UV coordinates for lines or generate one then use that to color the line. Pass in time to scroll something like

Of course you can also use a texture instead of code for the colors

The question and quoted portions thereof are CC BY-SA 3.0 by K.Miao from here
Issue/Bug? Create an issue on github.
Use <pre><code>code goes here</code></pre> for code blocks
comments powered by Disqus