Examples#
Antialiasing#
Demonstrates antialiasing for Lines, Points, and Text.
Three nodes are shown — a diagonal line, a disc point, and a text label —
each supporting the antialias property.
Interaction - Left-click anywhere in the view to toggle antialiasing on all nodes. The status text updates to reflect the current state.
Antialiasing is most noticeable on the diagonal line (jagged stairstepping appears on its edges without AA) and on the curved edge of the disc.
Basic Line#
Demonstrates a line with a vertex colormap iff the user hovers over it.
Basic Mesh#
Interactive mesh example demonstrating ColorModel subclasses.
This example shows: - Per-vertex coloring with VertexColors (gradient based on position) - Uniform coloring with UniformColor (solid purple) - Interactive face removal on mouse hover - Cycling between color models with right-click - Mesh reset on left-click
The mesh starts with per-vertex colors creating a colorful gradient. Right-clicking toggles between per-vertex and uniform coloring modes.
Basic Points#
Interactive points example demonstrating ColorModel subclasses and scaling modes.
This example shows: - Per-vertex coloring with VertexColors (each point gets a different color) - Uniform coloring with UniformColor (all points same color) - Fixed vs. scene-based point scaling modes - Interactive color swapping on mouse hover (face and edge colors swap)
The points start with per-vertex face colors (red, green, blue, yellow) and a white uniform edge. When the mouse hovers over any point, the colors invert: faces become white (uniform) and edges become colored (per-vertex).
Scaling modes: - "fixed": Point size in pixels, stays constant when zooming - "scene": Point size in world-space units, scales when zooming
Basic Scene#
Demonstrates a basic scene with multiple visual elements and imgui controls.
Basic Text#
Demonstrates rendering text.
Basic Volume#
Demonstrates 3D volume rendering with orbit camera controls.
Blending#
An example demonstrating different blend modes.
Unaltered, each channel of the volume is blended additively, resulting in transparency.
By clicking on the green volume, the blend mode will cycle through the available modes.
Cursor Points#
Shows how event filters can be used to change the cursor bitmap.
Draggable Rect#
Draggable rectangle with corner handles overlaid on a grayscale image.
Pixels contained within the rectangle are inverted in the background image. Note that, for a pixel to be considered "contained" its center must be contained.
This example demonstrates: - Composing a rectangle from three nodes: a semi-transparent mesh (fill), a solid line (outline), and disc point markers (handles). - Using an event filter to implement click-and-drag interactions. - Changing cursor shapes to signal behaviors.
Event Filters#
Demonstrates how event filters can be used to interact with a scene.
In this example, a yellow square is drawn under the mouse cursor when it hovers over an image. When the mouse leaves the image, a bright border is drawn around it.
Histogram#
An interactive histogram.
Keyboard Pan Zoom#
Demonstrates keyboard-driven pan and zoom on top of the PanZoom controller.
Arrow keys pan the view; + and - zoom in and out. Mouse drag and scroll continue to work as normal via the PanZoom controller.
Multi View#
Demonstrates multiple views of volumetric data with interactive slicing.
Shows two channels of volumetric data: the left view displays the full volume with a perspective camera where mousing over the volume extracts and displays a 2D slice from the other channel in pink at the intersection point. The right view shows an orthographic top-down perspective with no interaction.
Regions#
Demonstrates various layout options for positioning a view on a canvas.
Each layout is described by x_start, x_end, y_start, and y_end Dim values. Click on the image to cycle through the examples. The active layout is printed to the terminal. Resize the window to see how each configuration responds!
Rgb#
Demonstrates displaying an RGB image.
Pressing the mouse buttons cycles through the R, G, and B channels Releasing the mouse button returns to the full RGB image.