Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions HermiteCurve3.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
//tension: 1 high, 0 normal, -1 low
//bias: 0 is even, positive is towards first segment, negative towards the other

THREE.Curve.Utils.hermiteInterpolate = function (p0, p1, p2, p3, t, tension, bias) {
var _hermiteInterpolate = (p0, p1, p2, p3, t, tension, bias) => {
var m0 = (p1 - p0) * (1 + bias) * (1 - tension) / 2
+ (p2 - p1) * (1 - bias) * (1 - tension) / 2;

Expand Down Expand Up @@ -45,9 +45,9 @@ THREE.HermiteCurve3 = THREE.Curve.create(

var vector = new THREE.Vector3();

vector.x = THREE.Curve.Utils.hermiteInterpolate( point0.x, point1.x, point2.x, point3.x, weight, this.tension, this.bias );
vector.y = THREE.Curve.Utils.hermiteInterpolate( point0.y, point1.y, point2.y, point3.y, weight, this.tension, this.bias );
vector.z = THREE.Curve.Utils.hermiteInterpolate( point0.z, point1.z, point2.z, point3.z, weight, this.tension, this.bias );
vector.x = _hermiteInterpolate( point0.x, point1.x, point2.x, point3.x, weight, this.tension, this.bias );
vector.y = _hermiteInterpolate( point0.y, point1.y, point2.y, point3.y, weight, this.tension, this.bias );
vector.z = _hermiteInterpolate( point0.z, point1.z, point2.z, point3.z, weight, this.tension, this.bias );

return vector;
}
Expand Down
2 changes: 1 addition & 1 deletion index.html
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@
</div>
<div id="container"></div>

<script src="three.js"></script>
<script src="https://unpkg.com/three/build/three.min.js"></script>
<script src="orbit-controls.js"></script>
<script src="js-struct.js"></script>
<script src="HermiteCurve3.js"></script>
Expand Down
2 changes: 1 addition & 1 deletion orbit-controls.js
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ THREE.OrbitControls = function ( object, domElement ) {
// so camera.up is the orbit axis

var quat = new THREE.Quaternion().setFromUnitVectors( object.up, new THREE.Vector3( 0, 1, 0 ) );
var quatInverse = quat.clone().inverse();
var quatInverse = quat.clone().invert();

// events

Expand Down
Loading