public Vector3 P(int i, int j, float u, float w) { Vector3 P3 = CardinalSpline.P(controlPoints[i + 3, j], controlPoints[i + 3, j + 1], controlPoints[i + 3, j + 2], controlPoints[i + 3, j + 3], w, 0.5f); Vector3 P2 = CardinalSpline.P(controlPoints[i + 2, j], controlPoints[i + 2, j + 1], controlPoints[i + 2, j + 2], controlPoints[i + 2, j + 3], w, 0.5f); Vector3 P1 = CardinalSpline.P(controlPoints[i + 1, j], controlPoints[i + 1, j + 1], controlPoints[i + 1, j + 2], controlPoints[i + 1, j + 3], w, 0.5f); Vector3 P0 = CardinalSpline.P(controlPoints[i + 0, j], controlPoints[i + 0, j + 1], controlPoints[i + 0, j + 2], controlPoints[i + 0, j + 3], w, 0.5f); Vector3 result = CardinalSpline.P(P0, P1, P2, P3, u, 0.5f); return(result); }