Browse Source

fix CatmullRomCurve3 end-point extrapolation

it used to choose the last point as extrapolant, which is of course not intended.
now correctly extrapolates beginning at last point.
Tobias Gurdan 10 years ago
parent
commit
73880733d5
1 changed files with 1 additions and 1 deletions
  1. 1 1
      src/extras/curves/CatmullRomCurve3.js

+ 1 - 1
src/extras/curves/CatmullRomCurve3.js

@@ -131,7 +131,7 @@ THREE.CatmullRomCurve3 = ( function() {
 			} else {
 
 				// extrapolate last point
-				tmp.subVectors( points[ l - 1 ], points[ l - 2 ] ).add( points[ l - 2 ] );
+				tmp.subVectors( points[ l - 1 ], points[ l - 2 ] ).add( points[ l - 1 ] );
 				p3 = tmp;
 
 			}