Leo Long Posted December 13, 2016 Share Posted December 13, 2016 hello!!! I'm new to babylon.js, and now i have a project in which i need to draw line on plane. the width of lines is controllable. is there has any ways to easily reach it? thanks Quote Link to comment Share on other sites More sharing options...
JohnK Posted December 13, 2016 Share Posted December 13, 2016 Hi and welcome. As far as I know you cannot set the width of a line. You could use a ribbon, cylinder or another plane to represent the line. Try it out in a playground and if you have problems show us the playground. Quote Link to comment Share on other sites More sharing options...
Pryme8 Posted December 13, 2016 Share Posted December 13, 2016 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. Quote Link to comment Share on other sites More sharing options...
iiceman Posted December 13, 2016 Share Posted December 13, 2016 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 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? Quote Link to comment Share on other sites More sharing options...
Recommended Posts
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.