How boshinomikoto/mdlviewer works
ModelsViewer is a Urho3D desktop model viewer. Users choose an MDL model and optional XML material, load it into a 3D scene, then adjust object transforms and material color through the UI while navigating with the camera controls. The sampled code shows startup assembling the UI and scene, and the load handler calling the model loader; several UI-to-handler and renderer relationships are documented or implied but not fully shown. Native file dialogs are supplied by the bundled cross-platform NFD library.
Main entry points: Core.cpp App startup · Handlers.cpp UI and input handlers · Scene.cpp Scene and lighting · nfd.h Dialog API
Components 16
Application
- Application entry
main.cpp - App startup
src/Core.cpp - Scene viewport
src/Core.cpp
User Interaction
- Viewer UI
src/UI.cpp - UI and input handlers
src/Handlers.cpp - Camera controls
src/Handlers.cpp - Object transforms and color
src/Handlers.cpp
Scene and Assets
- Scene and lighting
src/Scene.cpp - Model and material loader
src/Utils.cpp - Model and material files
Data/Materials
Native File Dialogs
- Dialog API
external/nfd/src/include/nfd.h - Windows dialog backend
external/nfd/src/nfd_win.cpp - GTK dialog backend
external/nfd/src/nfd_gtk.cpp - Portal dialog backend
external/nfd/src/nfd_portal.cpp
Other components
- Viewer user
- Urho3D runtime
Connections 18
- Viewer user → Viewer UI: operates
README.md - Application entry → App startup: starts
- App startup → Viewer UI: initializes
src/Core.cpp - App startup → Scene and lighting: creates
src/Core.cpp - App startup → Scene viewport: sets up
src/Core.cpp - Scene viewport → Scene and lighting: renders
src/Core.cpp - Viewer UI → UI and input handlers: dispatches events
- UI and input handlers → Dialog API: opens dialogs
src/Handlers.cpp - UI and input handlers → Model and material loader: loads model
src/Handlers.cpp - UI and input handlers → Camera controls: handles navigation
src/Handlers.cpp - UI and input handlers → Object transforms and color: handles edits
src/Handlers.cpp - Scene and lighting → Model and material loader: loads default model
src/Scene.cpp - Model and material loader → Model and material files: reads resources
src/Utils.cpp - App startup → Urho3D runtime: uses
src/Core.cpp - Scene and lighting → Urho3D runtime: builds scene
src/Scene.cpp - Windows dialog backend → Dialog API: implements
external/nfd/src/nfd_win.cpp - GTK dialog backend → Dialog API: implements
external/nfd/src/nfd_gtk.cpp - Portal dialog backend → Dialog API: implements
external/nfd/src/nfd_portal.cpp