Jump to content

canvas image 2d to texture


hit2501
 Share

Recommended Posts

Hi everyone!

 

I dont have experience with 2d canvas, thats the reason for my basic question  :rolleyes:.

 

I have an 2d image in a canvas but I dont know how can I do to put this image over a mesh (imported from blender) as a texture. 

 

Can anybody show me an example.

 

Thank you all.

 

 

Link to comment
Share on other sites

If you already created the canvas and you have access to it (you have, for example, his id) you can use the canvas element's toDataURL() to get a base64 data string. This string can be used as the url variable of a texture.

If you want Babylon to create the canvas, use dynamic textures.

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