Jump to content

how to paint on a plane with mouse and erase them


Leo Long
 Share

Recommended Posts

by creating a hidden canvas element, converting it to a uri element and having it be drawn on by interactions with the plane mesh.  Then on a set interval refresh the texture to the uri element and have that assigned as the diffuse of the mesh.

Link to comment
Share on other sites

Hi Leo and welcome tot he forum!

With line you mean a hand drawn line like that: http://www.babylonjs-playground.com/#9U086#4 (click and drag)

Or you need a really straight line? Edit: gave that a try and it wasn't too hard: http://www.babylonjs-playground.com/#9U086#109 (click and drag, line is drawn on release)

Edit 2: And here, just for fun, the fancy version where you can actually see the line while drawing it: http://www.babylonjs-playground.com/#9U086#110:D

About the erasing: like an undo function that reverts the previous drawn line or like a paint brush that erases only the parts of the line that you brush over?

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