AB4D Forum
EdgeLinesFactory CreateEdgeLines wrong index buffer returned for PlaneModelNode - 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: EdgeLinesFactory CreateEdgeLines wrong index buffer returned for PlaneModelNode (/showthread.php?tid=4498)



EdgeLinesFactory CreateEdgeLines wrong index buffer returned for PlaneModelNode - BiMMate - 10-19-2025

Hello

Could it be possible that CreateEdgeLines method in EdgeLinesFactory static class is returning wrong index buffer so outter edges are rendered in diagonal?


RE: EdgeLinesFactory CreateEdgeLines wrong index buffer returned for PlaneModelNode - abenedik - 10-20-2025

I have checked that and found out that there is an optimized code path for edge line generation where the mesh has only 4 positions (also for plane mesh). In this case, the code produces invalid indices for edge lines when the positions for the mesh are not organized in a nice clockwise or counter-clockwise direction. This also happens for the default plane mesh, where the indexes of the positions ordered in the clockwise directions are: 0, 1, 3, 2.

I have just updated the code so it now correctly finds where the diagonal lies and, based on that, generates the edge lines. The code now also handles a few invalid meshes more correctly.

I will now also add support for frustum culling (as promised in this post) and then prepare a pre-release version for you.


RE: EdgeLinesFactory CreateEdgeLines wrong index buffer returned for PlaneModelNode - BiMMate - 10-30-2025

Thanks Andrej for the new release

This completely fix my issue