Commit ee1b04b3 authored by Lars Krecklau's avatar Lars Krecklau Committed by Janis Born
Browse files

* Fixed a bug in the NURBSCurve knot normalization (the offset could have been...

* Fixed a bug in the NURBSCurve knot normalization (the offset could have been wrong in certain situations)
parent 775b123f
......@@ -232,11 +232,12 @@ public:
//namely between the knots (degree) and (#knots - degree - 1)
void normalizeKnotVector(void)
{
float fSpan = mKnots[mKnots.size() - mOrder] - mKnots[mDegree];
float offset = mKnots[mDegree];
float span = mKnots[mKnots.size() - mOrder] - offset;
for(std::vector<float>::size_type i = 0; i < mKnots.size(); ++i)
{
mKnots[i] -= mKnots[mDegree];
mKnots[i] /= fSpan;
mKnots[i] -= offset;
mKnots[i] /= span;
}
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment