Skip to content
Snippets Groups Projects
Commit 9cf8b037 authored by Neil Gershenfeld's avatar Neil Gershenfeld
Browse files

wip

parent 9ffc4885
Branches
No related tags found
No related merge requests found
......@@ -435,24 +435,6 @@ function worker() {
return([x3,y3,z3])
}
//
// function to draw line
//
function line(x0,y0,x1,y1) {
var x = x0
var y = y0
var dx = (x1-x0)/100
var dy = (y1-y0)/100
for (var i = 0; i < 100; ++i) {
x += dx
y += dy
ix = Math.round(w*(x-xmin)/(xmax-xmin))
iy = Math.round(h*(y-ymin)/(ymax-ymin))
buf[(h-1-iy)*w*4+ix*4+0] = 255
buf[(h-1-iy)*w*4+ix*4+1] = 255
buf[(h-1-iy)*w*4+ix*4+2] = 255
}
}
//
// get vars from buffer
//
var endian = true
......@@ -538,9 +520,19 @@ function worker() {
var y1 = v[1][1]+(v[0][1]-v[1][1])
*(v[1][2]-(zmax-depth))/(v[1][2]-v[0][2])
}
line(x0,y0,x1,y1)
if (y0 < y1)
segs.push([x0,y0,x1,y1])
else
segs.push([x1,y1,x0,y0])
}
}
//
// sort segments
// map reduce filter foreach sort summon heroes
//
segs.map(
//
// fill interior
//
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment