Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions frontend/src/app/components/viewer3d.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,14 @@ declare global {
}
}

/**
* Render a GLTF/GLB model and signal when its primary scene becomes visible.
*
* Resolves a provided model URL to an absolute URL when running in a browser, loads the GLTF, and renders its scene as a primitive. After the scene is available, schedules a single animation frame that records the visibility timestamp on `window.__lod0VisibleAt` and dispatches a `CustomEvent` named `"lod0:visible"` with `{ ts }` in `event.detail`.
*
* @param modelUrl - The model file URL (absolute or relative). Relative URLs are resolved against `window.location.origin` when available.
* @returns A JSX element that renders the loaded GLTF scene.
*/
function Model({ modelUrl }: { modelUrl: string }) {
// Resolve absolute URL to avoid base path issues
const src = useMemo(() => {
Expand Down