VictorF

Basic example not working in my server/with my assets

Recommended Posts

https://www.babylonjs-playground.com/#A3M2K3

That is a really really simple example that works ok with the providen url

 

boxMaterial.reflectionTexture = new BABYLON.CubeTexture("http://babylonjsguide.github.io/img/", scene, ["cubeSide_nx.jpg", "cubeSide_nx.jpg", "cubeSide_nx.jpg", "cubeSide_nx.jpg", "cubeSide_nx.jpg", "cubeSide_nx.jpg"]);

but fails using my own server 

boxMaterial.reflectionTexture = new BABYLON.CubeTexture("http://www.motivacg.com/temporal/victor/CubeBabylon/", scene, ["SalonA_nx.jpg", "SalonA_nx.jpg", "SalonA_nx.jpg", "SalonA_nx.jpg", "SalonA_nx.jpg", "SalonA_nx.jpg"]);


Obviously you can get the SalonA_nx.jpg file without problem using that url.

Any tip about this? thank you in advance and sorry for being such newbie!

Share this post


Link to post
Share on other sites

You need to setup CORS on your images, if you want them to work in the playground (ie: put them on github).  The good news is that it will work on the same server without CORS.

Don't be sorry for being a newbie - we all started somewhere.  Much better to be a newbie and learn new things :)

Share this post


Link to post
Share on other sites
29 minutes ago, brianzinn said:

You need to setup CORS on your images, if you want them to work in the playground (ie: put them on github).  The good news is that it will work on the same server without CORS.

Don't be sorry for being a newbie - we all started somewhere.  Much better to be a newbie and learn new things :)

Thank you so much! it worked like a charm.

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...

  • Recently Browsing   0 members

    No registered users viewing this page.