: Documentation : Interaction Tutorials


This tutorial demonstrates an interaction technique based on paddle interaction: the Magic Lens. This technique places a virtual magnifying glass on the paddle, and this can be used to inspect virtual content on the reference marker. However, because the interface is virtual, we can control the types of visualization that occur within the lens area. For example, rather than magnifying objects, we can see through them, change their appearance, or annotate them.


To create the Magic Lens effect, we need to divide the view into two regions: one within the lens, and one outside. This can be achieved by creating a mask within the OpenGL Stencil Buffer. The stencil buffer is a fullscreen buffer, similar to the framebuffer and depth buffer, but it is used to control which pixels are drawn to during a rendering pass.

The mask within the stencil buffer can be created by rendering directly into the stencil buffer.