Jump to content

Test: Difference between revisions

From Survivalcraft Wiki
No edit summary
No edit summary
Line 15: Line 15:
</tr>
</tr>


</table>
<html>
<head>
  <script type="module" src="https://ajax.googleapis.com/ajax/libs/model-viewer/4.0.0/model-viewer.min.js"></script>
</head>
<body>
<model-viewer id="bearModel"
  src="https://survivalcraft.wiki/content/Models/Bear.glb"
  ar shadow-intensity="1"
  camera-controls touch-action="pan-y">
</model-viewer>
<script type="module">
  const modelViewer = document.querySelector('#bearModel');
  modelViewer.addEventListener('load', () => {
    const THREE = modelViewer?.threejs;
    if (!THREE) {
      console.error('threejs not exposed by <model-viewer>');
      return;
    }
    // Find the mesh/material to change
    modelViewer.model.scene.traverse((node) => {
      if (node.isMesh) {
        const loader = new THREE.TextureLoader();
        loader.load('https://survivalcraft.wiki/content/Textures/Creatures/Bear_Brown.png', (texture) => {
          // Apply to material
          node.material.map = texture;
          node.material.needsUpdate = true;
        });
      }
    });
  });
</script>
</body>
</html>





Revision as of 17:36, 28 July 2025


Cell 1 Cell 2
Cell 3 Cell 4