ホーム » 3D » Rational B-Spline

2018年2月
 123
45678910
11121314151617
18192021222324
25262728  

カテゴリー

アーカイブ

ブログ統計情報

  • 77,344 アクセス



Rational B-Spline

Vd4 として w に設定してみたが,これで良いのか?

Vd3A	b_spline	(const Vd4& q0,const Vd4& q1,const Vd4& q2,const Vd4& q3,const long div_c)
{
	Vd3A	vd3a ;
	for (long index=0 ; index<=div_c ; index++) {
		double	t  = 1./div_c*index ;
		double	n0 = 1./6 * (1.-t)*(1.-t)*(1.-t) ;
		double	n1 = 1./2 * t*t*t - t*t + 2./3 ;
		double	n2 =-1./2 * t*t*t + 1./2 * t*t + 1./2 *t + 1./6 ;
		double	n3 = 1./6 * t*t*t ;
		double	px = ( (n0*q0.x)*q0.w + (n1*q1.x)*q1.w + (n2*q2.x)*q2.w + (n3*q3.x)*q3.w ) / ((n0)*q0.w + (n1)*q1.w + (n2)*q2.w + (n3)*q3.w) ;
		double	py = ( (n0*q0.y)*q0.w + (n1*q1.y)*q1.w + (n2*q2.y)*q2.w + (n3*q3.y)*q3.w ) / ((n0)*q0.w + (n1)*q1.w + (n2)*q2.w + (n3)*q3.w) ;
		double	pz = ( (n0*q0.z)*q0.w + (n1*q1.z)*q1.w + (n2*q2.z)*q2.w + (n3*q3.z)*q3.w ) / ((n0)*q0.w + (n1)*q1.w + (n2)*q2.w + (n3)*q3.w) ;
		vd3a.push_back(Vd3(px,py,pz)) ;
		}
	return	vd3a ;
	}

Is this 投稿 useful? Useful Useless 0 of 0 people say this 投稿 is useful.

コメントする

メールアドレスが公開されることはありません。 * が付いている欄は必須項目です

%d人のブロガーが「いいね」をつけました。