mrdoob/three.js — Issue #1408: Question about SplineCurve3 getTangent function
Author: alanwol
Created: 2012-02-27 12:04:29+00:00
State: open

I've created a straightline SplineCurve3 that walks into the negative z-axis. See http://jsfiddle.net/JegTz/ for the source page.

When I call the getTangent function it returns the vector (0,0,1) see the console log. This points in the positive z direction. How can I get the tangent vector to point in the direction that the cube is moving?

One possible solution I have is to calculate a point later in time and use the dot product between the difference vector of the points and the tangent vector but I would expect that the tangent would point in the direction of increasing t.

I'm trying to have a cube follow the spline and I'm using cube.lookAt together with the tangent vector to orient the cube. I've read two issues about this topic here but that didn't help much.

Thanks for your great help with my previous issue.