瀏覽代碼

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 年之前
父節點
當前提交
73880733d5
共有 1 個文件被更改,包括 1 次插入1 次删除
  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;
 
 			}