calcBSplinePoint function
dynamic
calcBSplinePoint(
- dynamic p,
- dynamic U,
- dynamic P,
- dynamic u,
Implementation
calcBSplinePoint(p, U, P, u) {
var span = findSpan(p, u, U);
var n = calcBasisFunctions(span, u, p, U);
var c = Vector4(0, 0, 0, 0);
for (var j = 0; j <= p; ++j) {
var point = P[span - p + j];
var nj = n[j];
var wNj = point.w * nj;
c.x += point.x * wNj;
c.y += point.y * wNj;
c.z += point.z * wNj;
c.w += point.w * nj;
}
return c;
}