From 43d85fd34dc554eb4ad90a09c5ae9499ad99d387 Mon Sep 17 00:00:00 2001 From: Francisco Dans Date: Fri, 14 Aug 2015 00:42:09 +0200 Subject: [PATCH] adds interpolation as an option --- lib/torque/renderer/point.js | 46 +++++++++++++++++++----------------- 1 file changed, 24 insertions(+), 22 deletions(-) diff --git a/lib/torque/renderer/point.js b/lib/torque/renderer/point.js index 3ce0c7b..00b8f9c 100644 --- a/lib/torque/renderer/point.js +++ b/lib/torque/renderer/point.js @@ -199,24 +199,6 @@ var contour = require('./contour'); prof.end(true); }, - _gridData(tile){ - var res = this.options.resolution; - var grid = new Array(256/res); - for(var i =0; i= contour){ @@ -339,10 +340,11 @@ var contour = require('./contour'); return "0"; }).join(""); var type = parseInt(parsedCell, 2); - var N = [this._lerp(cell[1], cell[0], contour), 0], - S = [this._lerp(cell[2], cell[3], contour), 1], - E = [1, this._lerp(cell[2], cell[1], contour)], - W = [0, this._lerp(cell[3], cell[0], contour)] + var interpolated = true; + var N = interpolated?[this._lerp(cell[1], cell[0], contour), 0]: [0.5,0], + S = interpolated?[this._lerp(cell[2], cell[3], contour), 1]: [0.5,1], + E = interpolated?[1, this._lerp(cell[2], cell[1], contour)]: [1,0.5], + W = interpolated?[0, this._lerp(cell[3], cell[0], contour)]: [0,0.5] // Blank if (type === 0 || type === 15) return null; // W - S