Online demos

Halo Highlighting

Object selection and highlighting is a critical part of providing a great user experience in your 3D application program.  The first requirement is fast “picking.”  It means that, when the user clicks, the application can identify which object or objects were selected.  A second, and equally important, requirement is effective “highlighting.”  Highlighting means to provide visual feedback that clearly shows the user which object or objects were selected.

Open Inventor provides both fast picking and effective highlighting.  Open Inventor 10.5 introduced a new technique called “halo” highlighting that provides a modern, esthetic, and efficient way of highlighting selected objects in a scene.  The halo highlighting tool draws the external contour or silhouette of a selected object, as shown in this image.

 

Previous versions of Open Inventor only provided two basic highlight techniques: Box and Line highlight, as shown in the following images.

  1.  A box highlight draws the bounding box of the selected object(s).
  2.  A line highlight draws the edges of the faces in the selected object(s).

 

These techniques are useful for simple shapes like a cone but have limitations for more complex shapes and complex scenes, as shown in the following images.

  1. A box highlight is ambiguous.  It does not allow the user to see clearly which object in the model was selected.
  2. A line highlight correctly identifies the selected object (and might be useful in some cases to show how the object was tessellated).  But, as visual feedback for selection, line highlighting adds a lot of “clutter” to the scene and can reduce performance due to the extra rendering.

 

Using a halo highlight is fast, looks good and unambiguously indicates which object was selected, as shown in this image:

 

As shown in the next image, it is also possible to make the halo always visible, even for parts of the selected object that are hidden by other objects in the scene. This makes it easier for the user to perceive the selected object in a very complex scene and also shows the overall shape of the selected object.

 

Halo highlighting is useful for much more than CAD models.  The halo effect is generated using the values that the GPU writes into the depth buffer while rendering a shape.  As a result, halo highlighting works with any Open Inventor shape.  For example, applications using VolumeViz can use halo highlighting with SoOrthoSlice, and other volume shapes, as shown in the following 3D medical viewer image.

 

Halo highlighting is also valuable for applications using MeshVizXLM to visualize, for example, large reservoir models used in oil and gas exploration.  Shapes like mesh skin (MoMeshSkin) are typically rendered with both faces and lines (edges), creating a large amount of geometry.  Like the motorcycle example, using a line highlight would redraw every edge, adding a lot of clutter and reducing performance.  The halo technique is a fast and efficient way to highlight these complex shapes, as shown in this image.

 

The color, size, and smoothing of the halo can be customized using functions setHaloColor, setHaloWidth, and setHaloSmoothFactor.  In the image above, we used a wide halo along with a high smoothing factor to give the appearance of a “glow” around the object. In the following images, we show the effect of these options.

Varying the halo width:

Varying the halo smoothing factor:

 

About Object Picking and Selection

Open Inventor provides a powerful picking tool.  SoRayPickAction can quickly find the object, or objects, under the user’s cursor.  It can also detect objects along any arbitrary ray in 3D space.  Open Inventor also provides a convenient high-level selection mechanism for objects in the scene.  The SoSelection group node manages a list of selected objects.  Each object in the list is an SoPath, and the path can lead to a single shape or a group node containing multiple shapes.  The application can add or remove objects from the list.  SoSelection can also automatically handle mouse click events, do picking, add the selected object(s) to the list, and notify the application when the selection list has changed.

The halo highlighting effect is provided by class SoHaloHighlightRenderAction(C++|Java|.Net).


Developer Tip: Highlighting text.

In the next image, the top row of text is an SoText3 node rendered using the default “Polygon” render style (see SoFont for details).  In this case, the halo effect is (effectively) applied to each character in the string.  That could be a desirable effect in some cases, but it could also be “too much” highlighting for a good user experience.

The middle row of text is an SoText3 rendered using the “Texture” render style.  This style is often preferred because anti-aliasing is applied when the textures are generated, creating a high-quality appearance.  However, the halo effect is (effectively) applied to the edges of each character’s texture rectangle, which is not very attractive.

The bottom row of text shows a solution: Render the string with a transparent background rectangle, using an SoTextProperty node with style set to BACK_FRAME.  Now the halo effect is applied to an invisible box surrounding the string.  The transparent background technique is also valuable because it makes it much easier for the user to select the string. Using only a text node, the user must click precisely on one of the characters to select the string.  Using a transparent background rectangle, the user can click anywhere “near” the string.

 

Conclusion

We invite you to run and experiment with the “HighlightingStyles” demo/example.  This program is located in the Highlight directory under Examples/source/Inventor/Features.  The demo allows you to load any .iv format file, choose a highlight style, and adjust the highlighting parameters.