Point3 SContext::UVW(int chan) { SCDebugPrint("SContext::UVW\n"); getTVerts(chan); uvw[chan] = baryCoord.x*tv[chan][0] + baryCoord.y*tv[chan][1] + baryCoord.z*tv[chan][2]; return uvw[chan]; }
// Returns the UVW derivatives for the point. Point3 SContext::DUVW(int chan) { SCDebugPrint("SContext::DUVW\n"); getTVerts(chan); calc_size_ratio(); duvw[chan] = 0.5f*(pabs(tv[chan][1]-tv[chan][0])+pabs(tv[chan][2]-tv[chan][0]))*ratio; return duvw[chan]; }
// This returns the bump basis vectors for UVW in camera space. void SContext::DPdUVW(Point3 dP[3], int chan) { getTVerts(chan); calc_size_ratio(); Point3 bv[3]; getObjVerts(); ComputeBumpVectors(tv[chan], obpos, bv); bumpv[chan][0] = Normalize(bv[0]); bumpv[chan][1] = Normalize(bv[1]); bumpv[chan][2] = Normalize(bv[2]); dP[0] = bumpv[chan][0]; dP[1] = bumpv[chan][1]; dP[2] = bumpv[chan][2]; }
// This returns the bump basis vectors for UVW in camera space. void SContext::DPdUVW(Point3 dP[3], int chan) { SCDebugPrint("SContext::DPdUVW\n"); getTVerts(chan); calc_size_ratio(); Point3 bv[3]; pInst->GetObjVerts(faceNum, obpos); ComputeBumpVectors(tv[chan], obpos, bv); bumpv[chan][0] = Normalize(bv[0]); bumpv[chan][1] = Normalize(bv[1]); bumpv[chan][2] = Normalize(bv[2]); dP[0] = bumpv[chan][0]; dP[1] = bumpv[chan][1]; dP[2] = bumpv[chan][2]; }
// Returns the UVW derivatives for the point. Point3 SContext::DUVW(int chan) { getTVerts(chan); calc_size_ratio(); return 0.5f*(pabs(tv[chan][1]-tv[chan][0])+pabs(tv[chan][2]-tv[chan][0]))*ratio; }