Distance of a specific point along a SplineCurve3 / TubeGeometry in Three.js? -


i'm trying find distance of specific point along splinecurve3 in three.js. example…

enter image description here

the above splinecurve3 has been constructed 4 pre-defined points; a, b, c , d. find point along curve can use getpoint method in curve class , provide value (t) along curve (between 0 – start [a] – and 1 – end [d]).

the problem have need find t value of intermediate points (b , c) used construct curve.

effectively, want reverse of getpoint. want pass point along path , given t (distance) beginning.

how can this? can't work out!

any , appreciated.

if memory serves me correctly, splinecurve3 catmull-rom spline, means t values @ a=0, b=1/3, c=2/3, d=3/3.

this generalized formula in source t = (point number) / (number of points - 1) https://github.com/mrdoob/three.js/blob/dev/src/extras/curves/splinecurve3.js#l19


Comments

Popular posts from this blog

.htaccess - First slash is removed after domain when entering a webpage in the browser -

Automatically create pages in phpfox -

c# - Farseer ContactListener is not working -