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

almost working, errors on Suzanne

parent 4ef17f51
Branches
No related tags found
No related merge requests found
......@@ -484,12 +484,13 @@ function map_worker() {
x += dir
if ((x < 0) || (x > (h-1))) continue
var z = z12+slope*(x-x12)
if (z > map[(h-1-y)*w+x]) {
map[(h-1-y)*w+x] = z
var iz = Math.floor(255*(z-zmin)/(zmax-zmin))
buf[(h-1-y)*w*4+x*4+0] = iz
buf[(h-1-y)*w*4+x*4+1] = iz
buf[(h-1-y)*w*4+x*4+2] = iz
//if (z > view.getFloat32((h-1-y)*4*w+x*4))
// view.setFloat32((h-1-y)*4*w+x*4,z)
}
}
}
}
......@@ -510,13 +511,13 @@ function map_worker() {
x += dir
if ((x < 0) || (x > (w-1))) continue
var z = z01+slope*(x-x01)
if (z > map[(h-1-y)*w+x]) {
map[(h-1-y)*w+x] = z
var iz = Math.floor(255*(z-zmin)/(zmax-zmin))
buf[(h-1-y)*w*4+x*4+0] = iz
buf[(h-1-y)*w*4+x*4+1] = iz
buf[(h-1-y)*w*4+x*4+2] = iz
//if (z > view.getFloat32((h-1-y)*4*w+x*4))
//if (z > view.getFloat32((h-1-y)*4*w+x*4))
// view.setFloat32((h-1-y)*4*w+x*4,z)
}
}
}
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment