Creating Motion Trails | KIRUPA


#1

by kirupa | 15 March 2016

Have you ever seen a comet or a meteor streaking across the sky? It looks something like this:


This is a companion discussion topic for the original entry at http://www.kirupa.com/canvas/creating_motion_trails.htm

#2

Hi there,
First off: congrats, you are just very very good at teaching stuff.
Following on the motion trails post.
The motion trail is never continuous and linear but rather gapy as if the previous positions were drawn every some pixels.
How do i get a continuous line? Thanks lot


#3

Are you trying to re-create something similar to a pen going across the screen? :slight_smile:


#4

Correct, how do I do that?


#5

Apologies for the delay. If you clear this line, your previous lines will still remain:

context.clearRect(0, 0, canvas.width, canvas.height);

You can play with this to selectively redraw only parts of your UI while keeping the other parts static :slight_smile:


#6

Hello, how can i force particle to move using not-random, but defined inside array/json file directions? Like i have many points on canvas starting from 0,0 and my particle should move to 100,100 then 200,300 then 66,66 in order ?


#7

Sorry for missing this earlier. Do you need it to move through those same points all the time, or will the points change at any point?