GLboolean CyclicCurve3::BlendingFunctionValues(GLdouble u,RowMatrix<GLdouble>& values) const { values.ResizeColumns(2 * _n + 1); for(GLuint i = 0; i < 2 * _n + 1; ++i) { values[i] = _c_n * pow(1.0 + cos(u - i * _lambda_n),(GLint)_n); } return GL_TRUE; }
GLboolean HermitePatch::VBlendingFunctionValues(GLdouble v_knot, RowMatrix<GLdouble> &blending_values) const { if (v_knot<0.0 || v_knot>1.0) return GL_FALSE; blending_values.ResizeColumns(4); GLdouble v=v_knot, v2=v*v, v3=v2*v; blending_values(0) = 2*v3 - 3*v2 + 1; blending_values(1) = -2*v3 + 3*v2; blending_values(2) = v3 - 2*v2 + v; blending_values(3) = v3 - v2; return GL_TRUE; }
GLboolean HermitePatch::UBlendingFunctionValues(GLdouble u_knot, RowMatrix<GLdouble> &blending_values) const { if (u_knot<0.0 || u_knot>1.0) return GL_FALSE; blending_values.ResizeColumns(4); GLdouble u=u_knot, u2=u*u, u3=u2*u; blending_values(0) = 2*u3 - 3*u2 + 1; blending_values(1) = -2*u3 + 3*u2; blending_values(2) = u3 - 2*u2 + u; blending_values(3) = u3 - u2; return GL_TRUE; }