xeokit-sdk
xeokit-sdk copied to clipboard
[FEATURE SUGGESTION] Clip distance measurements to near frustum plane
Describe the bug When zoom close to the surface, DistanceMeasurement not shown. It is possible to show all time?
Screenshots
Solution
Implement some 3D clipping within each DistanceMeasurement:
- after transforming the World-space start and end points of a distance measurement to View-space, split the point-to-point line into four disjoint 3D line segments: one for the point-to-point line, and three for the axis-aligned lines
- clip each of the four line segments separately against the near plane of the view volume
- set the 2D HTML distance and axis lines to the projected 2D coordinates of their respective clipped line segments
- skip whichever of these lines are fully in front of the near frustum plane
Fast solution, I change near to -0.05, but don't know is fully correct?
https://github.com/xeokit/xeokit-sdk/blob/02576b0be6dec9c4d8fc0f45bd408d4ffc05e449/src/plugins/DistanceMeasurementsPlugin/DistanceMeasurement.js#L288