xeokit / xeokit-sdk

Open source JavaScript SDK for viewing high-detail, full-precision 3D BIM and AEC models in the Web browser.
https://xeokit.io
Other
715 stars 286 forks source link

[FEATURE SUGGESTION] DistanceMeasurementsPlugin surface pointer #1360

Open g-rodigy opened 7 months ago

g-rodigy commented 7 months ago

Describe the solution you'd like When hover surface pointer must change not only color, but and form to square oriented paraller surface. At least for start to describe the algorithm, I will try to do it.

Describe alternatives you've considered Trimble Connect web version

Additional context image image

g-rodigy commented 7 months ago

So, I calculate it as difference between Сamera vector converted to euler angles and surface normalVector eurler angles, but limit additionally very large angle for css transform. Probably there is a better solution, because I don't know very well 3D mathematics.

paireks commented 7 months ago

Just sharing an idea: if you have 2 vectors in 3d - camera vector and surface's normal vector:

  1. calculate an acute angle between them both
  2. calculate a cross product for these vectors to get the axis of rotation
  3. rotate the square using calculated acute angle and calculated axis of rotation
paireks commented 5 months ago

Question if we want to add such option, or is it too specific for xeokit-sdk? :)

xeolabs commented 5 months ago

We don't currently have requirement for this ourselves on our roadmap.

However we would consider a PR if somebody wanted to contribute it as a helper component, similar to something like src/extras/PointerLens, that could be configured on the measurements plugins.