Game Development Reference
In-Depth Information
}else{
v->x = (pt1.x + pt2.x)/2.0;
v->y = (pt1.y + pt2.y)/2.0;
v->z = (pt1.z + pt2.z)/2.0;
}
break;
case 4:
//v2=3/4,cb[0]=3/8, cb[1]=0, cb[2],=-1/8,cb[3]=0
pt2.x = pts[v2].x * 0.75 +
pts[pc2.p[0]].x * 0.375 -
pts[pc2.p[2]].x * 0.125;
pt2.y = pts[v2].y * 0.75 +
pts[pc2.p[0]].y * 0.375 -
pts[pc2.p[2]].y * 0.125;
pt2.z = pts[v2].z * 0.75 +
pts[pc2.p[0]].z * 0.375 -
pts[pc2.p[2]].z * 0.125;
if (pc1.valence==6){
v->x = pt2.x; v->y = pt2.y; v->z = pt2.z;
}else{
v->x = (pt1.x + pt2.x)/2.0;
v->y = (pt1.y + pt2.y)/2.0;
v->z = (pt1.z + pt2.z)/2.0;
}
break;
case 6:
//ca[0],cb[0] = 1/2-w, ca[1],cb[1] = 1/8+2w,
//ca[2],ca[4],cb[2],cb4[]=-1/16-w
//ca[3],cb[3] = w;
if (pc1.valence==6){
v->x = pts[v1].x * (0.5-w) +
pts[v2].x * (0.5-w) +
pts[pc1.p[1]].x * (0.125 + 2*w) +
pts[pc1.p[5]].x * (0.125 + 2*w) +
pts[pc1.p[2]].x * (-0.0625 - w) +
pts[pc2.p[2]].x * (-0.0625 - w) +
pts[pc1.p[4]].x * (-0.0625 - w) +
pts[pc2.p[4]].x * (-0.0625 - w) +
pts[pc1.p[3]].x * w +
pts[pc2.p[3]].x * w;
v->y = pts[v1].y * (0.5-w) +
pts[v2].y * (0.5-w) +
Search Nedrilad ::




Custom Search