The HOOPS/3dAF distribution includes a variety of IM examples that show basic IM concepts. They are located in the <hoops>/demo/common/standard directory.
clip.c/objclip.c - demonstrates user-defined clipping
doily.c - demonstrates overloading of the 'draw dc faces' callback point to do custom drawing
lines.c/tracks.c - demonstrates user-defined lines
tristrip.c - demonstrates overloading of 'draw 3d tristrips', 'draw 3d polyedges', and 'draw 3d polymarkers'
Complex Clip Regions
When HOOPS/3dGS renders the scene, it creates an implicit window as discussed in Section 3.4. This 'internal' HOOPS window defines a rectangular view, or clip region. It is sometimes desirable to define a non-rectangular viewport to provide a detail view. This is achieved by setting a user-defined clip region within an IM callback, and any geometry drawn while that region is active will be clipped to it. For example, if we wanted to have all the geometry underneath a driver instance clipped to a pentagon-shaped clip-region, we would set a draw_segment callback on the driver instance segment. The callback would look like the following:
HOOPS/3dGS will perform the complex clipping logic in software by default, but can take advantage of display hardware to accelerate this feature. Acceleration can be requested by setting the ''stencil' Driver_Option on the desired driver instance prior to it's first update. If a 'stencil' buffer is available, then the complex clipped scene will render more quickly at the cost of extra video memory usage.