How playcanvas/supersplat-viewer works
Main components
• Frontend Web Application – The project is entirely client-side. The entry point is the index.html that loads the index.js and index.css.
• Camera Modules – Multiple camera-related modules (anim-camera.js, fly-camera.js, orbit-camera.js) indicate specialized components for different viewing and animation behaviors.
• Data and Configuration – The system supports external data input via URL parameters for settings (settings.json) and scene files (scene.compressed.ply). The settings schema provided in the README (defining camera, background, and animation tracks) is central to configuring the viewer.
• Build/Deployment and Development Tools – Build configuration files (rollup.config.mjs), the npm package configuration (package.json, package-lock.json), and the eslint.config.mjs all hint at the build process, code standards, and deployment pipeline supported by GitHub Actions (in .github/workflows).
Relationships and interactions
• Data Setup – Indicate that configuration (from URL parameters and settings.json) flows into the application, influencing camera behavior and scene construction.
Architectural patterns and principles
• Component-based Structure – Although not using a formal framework, the clear separation of functionality (rendering, camera control, utilities) suggests a modular design.
• Static Asset Generation – Illustrate how the project is bundled using a tool like Rollup. The build process takes the source files and produces a self-contained static website.
• Separation of Concerns – Illustrate separation between user interface elements (HTML/CSS) and behavior (JavaScript modules) along with distinct responsibilities (input handling, rendering, animation).