Draw a line on surface mesh!

Hello guys,


I want a function to view the terrain shape and measure its height. How can I draw a line from 2 points on the surface of the model.
Can anyone give me some directions. Any information is precious to me.
Thanks.

See
[SOLVED]Mesure distance between two points on a object by clicking - #34 by prisoner849
https://codepen.io/prisoner849/pen/NozKOL

and from the Collection of examples from discourse.threejs.org

ExtendedLineAtoB

1 Like

Thank you for your response. But what I want is a line connecting 2 points and lying on the surface of the object, not a line segment representing the distance of those 2 points.
Like that:

Maybe you can modify this example @prisoner849 ?

LineOnHover

One of solution is using geometry intersection. Line like thin box.

https://raw.githack.com/anhr/commonNodeJS/master/intersections/Examples/index.html
Or decals: three.js examples

@vacsHoai did any of the suggestions here work for you? I am trying to do the same thing (draw a surface line and do a measurement), but with a more complex mesh. Thanks!