- Published: 2025-08-20
- Updated: 2025-08-20
- MeshLib Team
MeshLib’s SDK 3D Viewer: What, How, and For Whom?

3D Viewer SDK is MeshLib’s plug-in rendering and UI layer. Written entirely in modern
C++, this compact Viewer engine opens a window, draws your geometry, and presents a ribbon-style interface.
Link the mrviewer module to quickly gain:
- Real-time OpenGL rendering for meshes, voxels, point clouds, and lines.
- A Dear ImGui ribbon UI with scene tree, toolbar, view cube, scale bar, and colour-scheme editor.
- Full window and input management (mouse, keyboard, SpaceMouse, touchpad, touchscreen).
- A global undo and redo history stack.
The whole bundle stays well under 10 MB. Thus, you can drop it into any C++ project and have graphics plus UI running in minutes. (mrviewer ships alongside the core geometry libraries—just link it whenever you need visualization).
Capabilities of MeshLib’s Rendering Engine
You definitely should give our rendering engine a try if you are planning to engineer a technical or scientific 3D application.
Data Types for Rendering
One of the first reasons to explore MeshLib’s 3D Viewer SDK is its broad data-type support. We are fully equipped to display the four formats software engineers and researchers need on a daily basis:
- Meshes, i.e., polygonal surface structures (triangulated) used to represent the shape and topology of 3D objects.
- Voxels, i.e., volumetric elements that make up a 3D grid, where each cell (i.e., voxel) represents a small cube of space and stores data such as density, material, or distance.
- Point clouds, i.e., unstructured XYZ samples with optional colors or normals, ideal for raw laser-scan or photogrammetry captures.
- Lines, i.e, lightweight chains of edges used for toolpaths, centerlines, section cuts, and other reference geometry.
Other data types.
Graphics Pipeline
Another reason to choose our 3D Viewer engine is that we already handle low-level GPU work for you, both on every desktop OS and even in the browser.
- Windows & Linux (desktop): OpenGL 4.3 core profile
- macOS (desktop): OpenGL 4.1 core profile
- Web (WebAssembly): WebGL 2.0 (OpenGL ES 3.0)
The same shader codebase (with small switches for GL/GL ES) compiles across targets, keeping scenes visually consistent everywhere.
Order-Independent Transparency (OIT)
Transparent parts are notoriously tricky. If you draw them in the wrong order, the scene shows dark halos or hides surfaces that should stay visible. Our Viewer SDK solves that for you, as it:
- Turns on automatically when the GPU supports OpenGL 4.3 or newer (typically modern Windows/Linux drivers).
- Ensures overlapping glassy parts, membranes, or iso-volumes blend correctly. No manual draw-order tricks are mandated.
- Falls back to classic depth-sorted blending on macOS and in WebGL, so transparent objects still render on older stacks.


Visual-Aid Features
Our Viewer SDK bundles three ‘quality-of-life’ tools that make inspection and presentation easier right out of the box:
Picker returns precise world-space coordinates and object IDs under the cursor, enabling point-and-click measurements, tooltips, or custom selection logic. It is implemented through the MR::Viewer::getPixelPointInfo and getMousePointInfo calls, which deliver a PointInAllSpaces structure (position, normal, object handle, viewport ID).

Texture support loads and binds bitmap textures to any mesh, so scanned colour data, decals, or UV-baked patterns render correctly. It is toggled via bindSceneTexture, with state checks via isSceneTextureBound and isSceneTextureEnabled.

Colour-map rendering applies scalar or categorical colour maps to object samples for stress plots, density fields, segmentation labels, and more. Colour maps are attached at object level (ObjectMesh, ObjectVoxels, etc.) via their material attributes.
UI Part
Our Viewer builds upon a simple principle: everything visual is already wired in. You just decide which widgets to show. Built on Dear ImGui, the GUI looks and behaves the same on Windows, macOS, Linux, and even inside a WebAssembly build. Also, our Ribbon-style navigation makes technical tools feel familiar to anyone who has ever used MS Office. Here is what we have in stock:
TrueType fonts shipped in the resources folder. ImGui loads them at launch, so your deploy won’t miss glyphs on a clean machine.
A hierarchical list of every object with visibility toggles. Implemented as an ImGui tree inside the Ribbon’s Scene tab.
A fuzzy text box that jumps to any object or command by name. Lives in the Ribbon header and queries Viewer’s internal object registry.
A context-sensitive row of icons (select, transform, measure, etc.). Plug-ins can append their own buttons through the ViewerPlugin interface.
A corner widget that snaps the camera to X, Y, or Z with one click. Your mouse hits are processed through the same picker you use for the scene

A small on-screen ruler tied to world units. It updates as you zoom and can be toggled in the View tab.
Window Management & Input Handling
Our rendering engine offers the full application loop. This means you do not have to bolt yet another framework on top. Everything below comes pre-wired, once again: one only intercepts the signals they care about.
Unified event loop. Call launchEventLoop. The Viewer will pump messages until stopEventLoop or the user closes the window. The same loop delivers every input modality as high-level callbacks, so your plug-in code stays short and portable.
- Mouse. Button down/up, movement, and scroll callbacks let you orbit, pan, or drag-select with zero boiler-plate (mouseDown, mouseMove, mouseScroll).
- Keyboard. Both raw keys (keyDown, keyUp, keyRepeat) and Unicode characters (keyPressed) land in the same queue, which means hotkeys and text fields ‘just work.’
- SpaceMouse. Six-degree-of-freedom translation and rotation via spaceMouseMove. Extra buttons arrive via spaceMouseDown/Up/Repeat. Perfect for CAD-style fly-throughs without writing HID code.
- Touchpad gestures. Rotate, swipe, and pinch-zoom begin/update/end signals are delivered as first-class events, so laptop users get native two-finger navigation.
- Touchscreen (WebAssembly). On the browser build, touchStart, touchMove, and touchEnd events map one-to-one with the same 2D coordinates you’d get from a mouse.
- Customisable viewports. Need a top/side/front triptych? Picture-in-picture? Call append_viewport to add a region, erase_viewport to remove it, and fitDataViewport to frame the geometry. Each viewport keeps its own camera settings, and functions like getHoveredViewportId let you track which one the user is interacting with.
- Cross-platform file dialogs. Open/save panels are baked into the Viewer’s menu actions and pop up via the native OS dialogs on Windows, macOS, and Linux. That means drag-and-drop paths, recent-file lists, and platform keyboard shortcuts behave exactly as users expect.

Why Opt for MeshLib’s Viewer?
If you’re building a new 3D tool, starting with MeshLib’s Viewer gives you a real head start. Here is the list of compelling reasons to give it a try.
- Build on top of a complete foundation. Our Viewer will serve you as a comprehensive UI and rendering layer designed to integrate cleanly with MeshLib’s core geometry stack. As we have mentioned above, you will start with everything wired in concurrently: camera, event loop, history, file dialogs, and rendering support for meshes, voxels, point clouds, and lines.
- Use one SDK for both processing and visualization. Instead of juggling separate libraries for mesh operations and 3D display, MeshLib gives you both. We mean everything from complex topology through selection and boolean ops to surface smoothing. It is all there, and it will work directly with the Viewer’s visual layer.
- Extend with plug-ins, not workarounds. The plug-in architecture lets you bolt on custom functionality without modifying the engine core. Add new object types, new tools, new UI tabs, you name it via clean, modular C++ extensions that share the Viewer state and history stack.
- Keep it lean and fast. The entire rendering layer, encompassing UI, shaders, textures, fonts, stays under 10 MB. That means short builds, fast startups, and no bloated dependencies.
- Deploy anywhere. Desktop builds run natively on Windows, Linux, and macOS. WebAssembly builds use the same API and rendering pipeline. As a result, you are free to deliver lightweight interactive tools directly in the browser without rewriting any core logic.
Long story short: MeshLib’s Viewer gives you just enough UI and graphics to ship your app fast. That is, without boxing you into someone else’s idea of what a 3D app should look like.
Who MeshLib’s Viewer Is For
Our engine shines anywhere you need faithful, fast 3D visualization, which includes:
- Dental and broader medical imaging for chair-side Viewers, implant planners, orthodontic tools, CT/MRI mesh inspection.
- Healthcare research with segmentation studies, anatomical measurements, custom analysis prototypes.
- Additive-manufacturing workflows in terms of slicers, build-prep apps, live process-monitoring dashboards, G-code or tool-path Viewers.
Python Wrapper
In addition to the full C++ SDK, MeshLib ships a lightweight Python wrapper, mrviewerpy. Its mission is to open the same Viewer window from a script. That is, the Python wrapper is a thin layer around the C++ core, enabling you to run a mesh-processing script, call one function, and instantly see the result. No need to export files or launch external solutions.
At the same time, the Python layer purposefully exposes only a handful of methods. You will not be able to build ribbon plug-ins or custom menus in Python. It is meant strictly as a fast visualization aid.
Software solutions powered by MeshLib Viewer
The dependability and efficiency of our SDK Viewer can be proven by the following two apps:
Check them out to learn what MeshLib’s SDK Viewer can do for you!
What our customers say
Thomas Tong
Founder, Polyga

Gal Cohen
CTO, customed.ai

Mariusz Hermansdorfer
Head of Computational Design at Henning Larsen Architechts

HeonJae Cho, DDS, MSD, PhD
Chief Executive Officer, 3DONS INC

Ruedger Rubbert
Chief Technology Officer, Brius Technologies Inc








Start Your Journey with MeshLib
MeshLib SDK offers multiple ways to dive in — from live technical demos to full application trials and hands-on SDK access. No complicated setups or hidden steps. Just the tools you need to start building smarter, faster, and better.
