Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Create a website using Spatial Web

Create a website using Spatial Web

visionOS 26 向けのウェブサイトを作ろう!
https://mercari.connpass.com/event/352787/

Avatar for Akio Itaya

Akio Itaya

June 18, 2025
Tweet

More Decks by Akio Itaya

Other Decks in Programming

Transcript

  1. <body> <model src=“bird.usdz” stagemode="orbit" > <img src="bird.png"> </model> </body> ࠨӈ΁ͷճస͕


    ՄೳʹͳΔ ·ͣ͸λοϓδΣενϟʔΛ௥Ճͯ͠ɺ
 ΠϕϯτΛݕ஌ͨ͠Β֯౓Λܭࢉͯ͠…
 ͱ͍࣮ͬͨ૷͕ෆཁʂ
  2. <body> <model src=“bird.usdz” stagemode="orbit" id="3d-model"> <img src="bird.png"> </model> <script> const

    model = document.getElementById('3d-model'); function turnRight() { const matrix = model.entityTransform; const newMatrix = matrix.rotateAxisAngle(0, 1, 0, 90); model.entityTransform = newMatrix; } </script> </body> ศརͳ൓໘ɺҰఆͷ੍໿͕͋Δ
  3. <body> <model src="bird.usdz" id="3d-model" stagemode="orbit" loop autoplay> <img src="bird.png" alt="bird

    image"> </model> <script> const model = document.getElementById('3d-model'); if (window.HTMLModelElement) { model.ready.then(() => { // ಡΈࠐΈ׬ྃ }).catch(() => { // ಡΈࠐΈࣦഊ }); } else { // ඇରԠϒϥ΢β } </script> </body> <model> αϙʔτͷ༗ແΛ֬ೝ
  4. <body> <model src="bird.usdz" id="3d-model" stagemode="orbit" loop autoplay> <img src="bird.png" alt="bird

    image"> </model> <script> const model = document.getElementById('3d-model'); if (window.HTMLModelElement) { model.ready.then(() => { // ಡΈࠐΈ׬ྃ }).catch(() => { // ಡΈࠐΈࣦഊ }); } else { // ඇରԠϒϥ΢β } </script> </body> ಡΈࠐΈεςʔλε ΋औಘՄೳ
  5. <body> <div id="loading"> <div class="spinner"></div> <p>Loading 3D model...</p> </div> <model

    src="bird.usdz" id="3d-model" stagemode="orbit" loop autoplay> <img src="bird.png" alt="bird image"> </model> <script> const model = document.getElementById('3d-model'); const loading = document.getElementById('loading'); if (window.HTMLModelElement) { model.ready.then(() => { loading.style.display = 'none'; }).catch(() => { loading.innerText = "Failed to load model."; }); } else { loading.style.display = 'none'; } </script> </body>