Skip to content

Fix: implemented dynamic GLB file loading logic#6

Open
steven-tired wants to merge 10 commits intomainfrom
dynamic-viewer
Open

Fix: implemented dynamic GLB file loading logic#6
steven-tired wants to merge 10 commits intomainfrom
dynamic-viewer

Conversation

@steven-tired
Copy link
Copy Markdown
Collaborator

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.

Zhuokai added 2 commits January 17, 2026 23:36
Resolved model interaction issues and control panel visibility bugs

Standardized filename casing for server compatibility
@steven-tired steven-tired reopened this Feb 2, 2026
@steven-tired steven-tired marked this pull request as ready for review April 14, 2026 05:56
Comment thread addDimLines.js Outdated
Comment thread default.html Outdated
Comment thread script.js Outdated
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>
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Comment thread script.js Outdated
src="${modelUrl}"
alt="${title}"
camera-controls
auto-rotate
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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"

`

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copy link
Copy Markdown
Collaborator Author

@steven-tired steven-tired left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants