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 = new 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;
}