You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm developing a plugin to measure distances between objects.
However, ray picking is not precise enough to consider my plugin as usable.
First, it is not possible to ray picking precision surface with matrix instead of origin & direction. Indeed, worldRayOrigin & worldRayDir are not set if a matrix is provided in pick params. See here. Is this an oversight or it is intended to does not work with matrix ?
Second, I used picking with matrix because it seems to be more precise. Indeed, the matrix ray picking example seems way more stable than the surface ray picking example. Comparing the code of both examples and the code on the Renderer.js, I saw that the only difference to go from origin & direction to matrix is this part:
Maybe these lines are responsible for the lack of precision when picking with origin & direction...
Measuring the Duplex roof is a good place to show the ray picking limitations:
No Precision
origin & direction:
matrix:
I seems better with matrix but in both no precision cases, the measure stops like 10cm before the wall...
For this kind of plugin, precision is key, precision picking needs to be enabled.
Precision
origin & direction:
It hardly catches the other wall :/
I did not manage to get a fix for this. Maybe the provided example code below can be used as a sandbox to improve the precision of the ray picking. In the example, there is two checkboxes as the top of the document to quickly enable precision ray picking and switching between matrix or origin & direction.
The following zip file is the measurements_distance_modelWithMeasurements example updated with the spacing measurement plugin.
@Kurtil@xeolabs I've been doing an experiment on top of DTX (data-textures) as the memory layout does not have precision loss in normals due to octencoding.
super-stable-measurements.mov
The measurement is 100% stable and its precision only bounded by the quantization error during XKT compression, which in many models just means sub-mm error 🥂.
I need to debug and profile this a bit more before pushing the code, so please have patience 🍿
I'm developing a plugin to measure distances between objects.
However, ray picking is not precise enough to consider my plugin as usable.
First, it is not possible to ray picking precision surface with
matrix
instead oforigin
&direction
. Indeed,worldRayOrigin
&worldRayDir
are not set if a matrix is provided in pickparams
. See here. Is this an oversight or it is intended to does not work with matrix ?Second, I used picking with matrix because it seems to be more precise. Indeed, the matrix ray picking example seems way more stable than the surface ray picking example. Comparing the code of both examples and the code on the Renderer.js, I saw that the only difference to go from
origin
&direction
tomatrix
is this part:Maybe these lines are responsible for the lack of precision when picking with
origin
&direction
...Measuring the Duplex roof is a good place to show the ray picking limitations:
No Precision
origin
&direction
:matrix
:I seems better with matrix but in both no precision cases, the measure stops like 10cm before the wall...
For this kind of plugin, precision is key, precision picking needs to be enabled.
Precision
origin
&direction
:It hardly catches the other wall :/
I did not manage to get a fix for this. Maybe the provided example code below can be used as a sandbox to improve the precision of the ray picking. In the example, there is two checkboxes as the top of the document to quickly enable precision ray picking and switching between
matrix
ororigin
&direction
.The following zip file is the measurements_distance_modelWithMeasurements example updated with the spacing measurement plugin.
measurements_distance_modelWithMeasurements.html.zip
The text was updated successfully, but these errors were encountered: