coco
coco

Reputation: 31

How to get elevation value(Z coordinate) from mesh surface giving X and Y in Three.js?

I would like to know if it is possible to get the Z coordinate of point in three js knowing X and Y of this point. I tested something : I draw a line in this X and Y coordinates and try to get the intersection of this line and the surface(Mesh) generated from tiff file. but many times it tells me that there is no intersection, and if i get one the coordinates of this intersection are (0,0,0). how can I get this Z coordinate ? enter image description here

Upvotes: 1

Views: 637

Answers (1)

fluffybunny
fluffybunny

Reputation: 506

The example under geometry/terrain/raycast does close to what you are asking. (direct clicky)

Short answer: use a raycaster.

Upvotes: 1

Related Questions