Creating a trailing line with three.js -


this similar want.

except i'd user see trailing line after first click. when user first clicks starting position fixed , line created end point current mouse location. ms paint line drawing functionality.

so when move mouse right want see line change.

maybe examples or pointers how implement it?

example

for future reference, first initiate 2 point line

var geometry = new three.geometry();  geometry.vertices.push(point); geometry.vertices.push(point);  var line = new three.line(geometry, new three.linebasicmaterial({})); 

then on mousemove replace last vertice latest mouse position.

line.geometry.vertices[last_point] = new_point; 

Comments