HOOPS Visualize supports the use of grids. Grids are often used as reference points, reference lines, or as guides for placing objects. Grids are planar, and cells can be square, rectangular, angled (parallelogram), or radial.
Grids are implemented as a collection of faces with edges and vertices. As such, the grid's edge attributes are controlled by the HPS::EdgeAttributeControl, and the vertex attributes are controlled by the HPS::MarkerAttributeControl. Attributes for a grid apply to the grid as a whole - you cannot set attributes on subparts.
One advantage of grids is that they can be infinite in extent. So, if you are using a grid as a background, you do not have to worry about how large to make the grid. HOOPS Visualize computes which parts of the grid are visible, and draws only those parts.
The calls to SetFirstPoint and SetSecondPoint represent a vector from the origin to which the point is drawn for each axis of the grid. The point is then repeated at regular intervals. By specifying two vectors that are not perpendicular, you can create non-traditional shapes for grid cells.
If you specify zero for the grid counts, the grid will extend infinitely. When viewed in perspective, infinite grids are drawn to infinity, smoothly vanishing toward the horizon.
Radial grids follow the same rules as quadrilateral grids. The only difference is that you would specify the HPS::Grid::Type::Radial enum when setting up the grid.
Customizing the appearance
The appearance of the grid lines can be customized to fit your needs. In this example, a custom line pattern and face color are applied to the grid. See our section on portfolios for more details on applying materials to lines and faces.