google-ar / codelab-webxr

Building an augmented reality application with the WebXR Device API
https://codelabs.developers.google.com/codelabs/ar-with-webxr/
Apache License 2.0
171 stars 85 forks source link

Changing the sunflower to another gltf #31

Open prp-e opened 2 years ago

prp-e commented 2 years ago

I had a gltf, and I changed the link here:

window.gltfLoader.load("https://immersive-web.github.io/webxr-samples/media/gltf/sunflower/sunflower.gltf", function(gltf) {
  const flower = gltf.scene.children.find(c => c.name === 'sunflower')
  flower.castShadow = true;
  window.sunflower = gltf.scene;
});

to something like http://mysite.com/mymodel.gltf and it is not working. I have no idea how I can change the sunflower properly. Now, I can successfully instantiate nothing on the screen 😂

Mawkk commented 2 years ago

Same problem would like to change the sunflower model with a different model of mine

prp-e commented 2 years ago

I switched to Model Viewer and it's much more straight-forward than this one!

@Mawkk

ghost commented 2 years ago

Hi, maybe its because of http. I think that https is required if working with non-localhost resources.