HI,
in my scene, I have a ground plane with a displacement map. A mouse click sets markers on the ground plane, although incorrectly on the y axis currently.
I need to be able to draw a path or line between these markers. I have tried and can’t figure this one out or find much info on how to do this.
Any help on ways to do this would really help.
Thanks
If I’m correct with my suggestion. Raycaster works on the javascript side, whereas displacementMap is used at the GPU side. So javascript knows nothing about how vertices changed on GPU.
There’s an example, showing the difference between using of displacement map in a material and displacing vertices in javascript, also based on the same displacement map. Note, how the marker behaves on meshes with different approaches (green - using .displacementMap, aqua - displacement in js):
Yes, I’m slowly realising this height value might not be available.
I might be able to make it by putting the displacement map into a canvas, then checking the red rgb value, then using that number as a Y value for the marker point. Lets see…