Esempio n. 1
0
// 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];
}
double minPointDistance( int& selectIndex, const PointD& point,std::vector<PointD> pointList )
{
    double minDistance = 1000;
    double r;

    int num = pointList.size();

    for ( int i = 0; i < num; ++i )
    {
        r = pabs( point - pointList[i] );

        if ( r < minDistance )
        {
            selectIndex = i;
            minDistance = r;
        }

    }

    return minDistance;
}
Esempio n. 3
0
// 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;
}