Hello! Can you help find a way to get the yellow center point?
default curve.geometry.boundingSphere.center gives me center where the red marker is
Hello! Can you help find a way to get the yellow center point?
default curve.geometry.boundingSphere.center gives me center where the red marker is
Hi!
Have a look at the docs: three.js docs
Something like this:
let midPoint = new THREE.Vector3();
curve.getPointAt(0.5, midPoint);
forget to say, that Iâm using the THREE.Line to draw this
And Line doesnât have this method
Then itâs better to provide an editable working live code example to demostrate what and how you do.
Based on your line data you can replicate a pure mathematical version of your line via THREE.Path and then use the method suggested by @prisoner849.
how could i represent it if Path is 2d?
working on it
Iâve assumed you curve lies in a conceptual 2D plane e.g. a XY plane.
If not, itâs correct that you canât use THREE.Path
. However, you can create an instance of THREE.CurvePath
and use the add()
method to add instances of THREE.LineCurve3
.
Iâll try this way
Thank you! This way enable me to get the mid point as the prisoner said. Canât mark 2 solution at once, but you both helped me. Many thanks!
Hey @insuby, would you mind sharing your solution?