masterdon Posted May 25, 2017 Share Posted May 25, 2017 Hi Team, I am having following code to create box(and also similar code to create planes in some cases): var box = BABYLON.MeshBuilder.CreateBox("box1", {width: sWidth, height: sHeight, depth: sDepth,updatable:true}, scene); box.enableEdgesRendering(); box.edgesWidth = 2.0; box.edgesColor = new BABYLON.Color4(0, 0, 1, 1); This creates solid edges on box/mesh. Is there any way to make dashed lines instead of solid ones. Quote Link to comment Share on other sites More sharing options...
brianzinn Posted May 26, 2017 Share Posted May 26, 2017 I only see the colour and edges properties you set, but I'm pretty new with babylonjs. There's surely a better way, but I've created custom edges for boxes by making my own texture - it's just a .png image for a texture. The code is here: https://doc.babylonjs.com/tutorials/createbox_per_face_textures_and_colors The last PG is more or less how I am doing it: http://www.babylonjs-playground.com/#1V3CAT#16 I made a dashed texture quickly and attached screenshot. Quote Link to comment Share on other sites More sharing options...
masterdon Posted May 26, 2017 Author Share Posted May 26, 2017 Hi Brian, I am not sure if that is going to work in my case. I want to create a structure that i have shared in below post. i.e. it should handle overlapping of border correctly when there are boxes horizontally and vertically. which exactly current edgerender mechanism does. Quote Link to comment Share on other sites More sharing options...
brianzinn Posted May 26, 2017 Share Posted May 26, 2017 No, my suggestion wouldn't work then because the texture is scaled. Hopefully somebody else can help you out. Quote Link to comment Share on other sites More sharing options...
NasimiAsl Posted May 27, 2017 Share Posted May 27, 2017 http://www.babylonjs-playground.com/#JB4YW#21 Quote Link to comment Share on other sites More sharing options...
masterdon Posted May 30, 2017 Author Share Posted May 30, 2017 @NasimiAsl: Thanks Nasim. I was thinking to extend enableEdgesRendering function to handle dashed line. something like enableDashedEdgesRendering. Need to see how many methods i have to modify for same. GameMonetize 1 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.