예제 #1
0
Vec3 BezierInterpolation(const Mat44& inv_mat,const Vec3 & P0,const Vec3 & P1,
	const Vec3 & P2,const Vec3 & P3, float t)
{
	// inv_mat = B Matrix, Mixture matrix.
	Vec4 U = Vec4(1.0,t, t*t, t*t*t);
	// A Matrix = UxB
	Vec4 A = U*inv_mat;
	// p(u) = UxBxP
	return P0*A.GetX() + P1*A.GetY() + P2*A.GetZ() + P3*A.GetW();
};
예제 #2
0
Vec3::Vec3(const Vec4 & vec){
	m_X = vec.GetX();
	m_Y = vec.GetY();
	m_Z = vec.GetZ();
}