Jump to content

Set dashed edges on mesh


masterdon
 Share

Recommended Posts

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. 

Link to comment
Share on other sites

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.

dash_texture_blocks.png

Link to comment
Share on other sites

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. 

 

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