adds spline converter
This commit is contained in:
parent
42df5d143f
commit
19c1e285ad
@ -265,6 +265,16 @@ torque.extend(IsoRenderer.prototype, torque.Event, {
|
||||
return gctx.getImageData(0, 0, 1, 256).data;
|
||||
},
|
||||
|
||||
cardinalSpline: function(line){
|
||||
var plainArray = [];
|
||||
for (var p = 0; p < line.length; p++){
|
||||
var interpolation = line[p].coord.interpolation || {x: 0.5, y: 0.5};
|
||||
plainArray.push(20 + 20*line[p].coord.x + 20 * interpolation.x);
|
||||
plainArray.push(20 + 20*line[p].coord.y + 20 * interpolation.y);
|
||||
}
|
||||
return cSpline(plainArray, 0.5, 25, true);
|
||||
}
|
||||
|
||||
/*
|
||||
CARDINAL SPLINE
|
||||
by Steffen Bär
|
||||
|
Loading…
Reference in New Issue
Block a user