Fix: implemented dynamic GLB file loading logic#6
Fix: implemented dynamic GLB file loading logic#6steven-tired wants to merge 10 commits intomainfrom
Conversation
Resolved model interaction issues and control panel visibility bugs Standardized filename casing for server compatibility
…ndow assignment - Wrapped logic in addDimLines.js into a function - Import the sheetdb API module to load the model
…arcas-app into dynamic-viewer
| auto-rotate | ||
| shadow-intensity="1" | ||
| style="width: 100%; height: 80vh;"> | ||
| <button name="hotspot-dot+X-Y+Z" slot="hotspot-dot+X-Y+Z" class="dot" data-position="1 -1 1" data-normal="1 0 0"></button> |
There was a problem hiding this comment.
Is there a reason to specify these buttons and lines here instead of in addDimLines.js where they were? It seemed cleaner and more modular to keep them together and just add them via modelViewer.innerHTML
There was a problem hiding this comment.
I moved the dimension-related DOM out of script.js and back into addDimLines.js by adding a small ensureDimensionMarkup(modelViewer) helper that injects the hotspots and svg#dimLines only when needed. script.js now renders a bare model-viewer plus the existing controls, while initDimensionLines() still owns the dimension behavior, labels, and visibility logic.
| src="${modelUrl}" | ||
| alt="${title}" | ||
| camera-controls | ||
| auto-rotate |
There was a problem hiding this comment.
Can we set these options how they were in carcas/utils/template.html lines 18-32? Those settings, especially AR options and no auto-rotate work better for mobile view.
For reference
`<model-viewer
id="bone-name"
ar
ar-modes="webxr scene-viewer quick-look"
ar-scale="fixed"
min-camera-orbit="-180deg 0deg auto"
max-camera-orbit="180deg 180deg auto"
max-field-of-view="90deg"
field-of-view="60deg"
shadow-intensity="1"
camera-controls
touch-action="pan-y"
src="bone-model-path"
alt="A 3D model of a bone-string"
environment-image="neutral"
poster="../carcas-models/posters/bone-name-poster.webp"
`
There was a problem hiding this comment.
I aligned the model-viewer options with carcas/utils/template.html as closely as possible for the dynamic page: removed auto-rotate, added the AR-related settings, camera orbit/FOV limits, touch-action, environment-image, and a dynamic poster URL. I verified on desktop that the viewer still loads correctly and the existing controls/dimension behavior were not affected. Mobile AR is still unverified because the current test server is only reachable through the remote desktop setup, not directly from a phone.
steven-tired
left a comment
There was a problem hiding this comment.
Added global.css in default.html (line 10), moved the dimension hotspots and svg#dimLines injection into addDimLines.js (line 1), and updated the model-viewer configuration in script.js (line 324) to align as closely as possible with template.html, including removing auto-rotate.
Verification status:
Desktop behavior looks good with no obvious issues.
Mobile AR is still pending verification because the current test environment is not directly reachable from a phone.
Revised default.html and script.js to automatically load model viewer rather than open html. Setting up a hardcode dictionary of glb files for model viewers to load.