Jump to content

Issue trying to update model texture


hit2501
 Share

Recommended Posts

Hi everyone!

 

I can change the texture of a model (imported from Blender) with an input type="file" and changing the parameter imgsource to a base64 image, it works fine using:

texture = new BABYLON.Texture('data:my_image_name3', scene, true, true, BABYLON.Texture.BILINEAR_SAMPLINGMODE, null, null, imgsource, true);

but when I try to change the parameter imgsource with: 

imgsource = canvas2.toDataURL();

The model only go black, I can´t understand because when I put the new imgsource on console.log it gives me the right base64 string.

 

Can you help me.

 

Thanks.

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...