AB4D Forum
Hit testing on LineNodes - Printable Version

+- AB4D Forum (https://forum.ab4d.com)
+-- Forum: Products Forums (https://forum.ab4d.com/forumdisplay.php?fid=4)
+--- Forum: Ab4d.SharpEngine (https://forum.ab4d.com/forumdisplay.php?fid=12)
+--- Thread: Hit testing on LineNodes (/showthread.php?tid=4405)



Hit testing on LineNodes - henkt - 07-10-2023

Do you plan to include a similar mechanism to LineSelectorData for hit testing on lines in the SharpEngine at some point?


RE: Hit testing on LineNodes - abenedik - 07-11-2023

Line selection is an essential feature.
Therefore I have added it to the engine and just published a new version of Ab4d.SharpEngine v0.9.13-beta3 with that class.

The samples are also updated and include the same LineSelectionSample as it is in Ab3d.PowerToys samples project.


RE: Hit testing on LineNodes - henkt - 07-15-2023

I am very impressed with your fast responses - you must be putting in 24 hour days


RE: Hit testing on LineNodes - abenedik - 04-23-2024

Lines hit can also be done by using an ID bitmap. This is created by rendering the scene to a bitmap where each object (and line) has its color based on the ID of the object.

I have just added a new sample (https://github.com/ab4d/Ab4d.SharpEngine.Samples/blob/main/Ab4d.SharpEngine.Samples.Common/HitTesting/HitTestingWithIdBitmapSample.cs) that shows how to render ID bitmap and use that select 3D lines.

This can be also easily extended to select a line when user is close to the line. This would be done by checking a few pixels away from the current mouse position and checking if any line is hit.