Jump to content

Why can not load image .png ; .jpg; .... ?


hulahula
 Share

Recommended Posts

Hello guys .

I have some issue whit image load texture. 

var panel = BABYLON.Mesh.CreateBox("panel", 0.2, scene);
var panelMat = new BABYLON.StandardMaterial("panel1",scene);	
	panelMat.diffuseTexture = new BABYLON.Texture("tpanel.png", scene);
	panel.material = panelMat;
	panel.scaling.z = 0.1;

In developer tools always show me this : 

index.html:1 : Access to Image at 'file:///C:/Users/user/Desktop/trapbox/tvorbamodelov/tpanel.png' from origin 'null' has been blocked by CORS policy: Invalid response. Origin 'null' is therefore not allowed access. 

babylon.js:3 :  BJS - [00:16:44]: Error while trying to load image: tpanel.png.

I am new in this and I am trying to understand how BABYLON.JS works.  

Thank you  in advance for your answers . 

 

Link to comment
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...
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...