Filled Polygons

Filled polygons for 3d lasso selection

Posted by Andreas Walch on 2019-05-15

Filled Polygons for 3d lasso selection

To integrate the well known 2D lasso selection into a 3D application is not trivial. The lasso forming points must not share the same 2D plane. Elevations or lowering within the lasso's area denies simple 2D shape renderings, because they may only be partly colored.

Image of 2D-shape intersection To efficiently color the inside of the lasso a clipping volume has to be derived from the lasso points. Based on Shadow Volume Technique the clipping volume is used to generate a stencil mask to draw the lasso inside.

The clipping volume can be formed in various ways, but mainly the lasso points are duplicated and shifted to put up a volume.

Plane Fitted

The simplest approach extrude a clipping volume by shifting all points along the same vector (the duplicated points into the inverse direction). A simple shift vector can be derived by using the regression plane's normal of the lasso points. To ensure that all elevations and lowering are included the shift offset has to be chosen accordingly. This approach is prone to lasso point's distributions within 3D space and can lead to undesirable coloring.

Image of clipping volume by regression plane

Axis-Single Point

More advanced shift vector need additional information about the 3D data. In case of caves or tunnel alike scenarios, a path or axis contributes useful information. For all lasso points, the closest point on the path is evaluated. The average point on the path can be used like a projection centre. All lasso points are shifted along their projection vector. This method allows to create areas spanning over both sides of a tunnel. Projection artefacts can occur by sparsely sampling the lasso areas.

Image of clipping volume by single point

Axis-Multiple Points

To counter the single-projection artefacts, each lasso point is shifted along the vector to its closest point on the axis. Unfortunately, the sides of the generated volume may not be planar, which leads to visible triangulation artefacts.

Image of triangulation artefacts

Axis-Multiple Points Subdivided

To futher improve stability and to counter the triangulation artefacts, the original lasso points are incorporated into the clipping volume. The lasso points do not contribute any new information to the clipping volume, but by reducing the distance between axis and dataset, the non-planar triangulation artefacts are barely visible.

Image of triangulation artefacts

Results

The sampling rate of the lasso has an impact on the boundaries of the clipping volume. To counter this problem additional support points could be automatically inserted into the selection to create a denser sampling rate. Overlapping and different colored lassos can be generated by using multiple draw passes.

Image of advanced clipping volume - results

Demo-Video

The video demonstrates the various techniques.

.