Statics

Line Thickness

Recommended Posts

Hi, I was wondering if there was anyway to adjust the thickness of a line.  I'm trying to make some lines stand out more than others.

 

I've been told to use a cylinder by some people in another post, but cylinders have issues when working with paths and when cameras are close to them.

 

right now the way I'm doing it is by putting several lines close to each other, but that looks messy and isn't quite perfect.

 

Thanks for any help!!

Share this post


Link to post
Share on other sites

I saw that there was a line vertex shader today.  If you look at it, it certainly looks like at the GPU level, width is passed/considered.

https://github.com/BabylonJS/Babylon.js/blob/master/src/Shaders/line.vertex.fx

 

It is an open source system.  Start digging in the .TS or .JS files, and you can probably answer your own question.

Share this post


Link to post
Share on other sites

We are thinking alike, DK... so, you might want to see a doctor.  :)

http://playground.babylonjs.com/#Z1SIC#1

But there could be ANOTHER way to make fat lines.  Drum roll please...

http://playground.babylonjs.com/#1IYSYD

ta-da!  errr... something.  :)  Here's some more mad fun.

Share this post


Link to post
Share on other sites

Maybe... at least a good solution for thick lines that are on a singular plane.


hmmm I just actually realized this is being overthought...  and I was about to do some fancy ribbon method that was going to be overkill...
http://playground.babylonjs.com/#Z1SIC#10


the tube solution with a custom shader set should do it.
http://playground.babylonjs.com/#Z1SIC#12
 

Share this post


Link to post
Share on other sites
On 6/27/2018 at 6:56 PM, JohnK said:

Hi all!

 

I use the "line2d" function too to display line segments with the same thickness.
A very awesome and useful function 👍!!!

In some situation, when the current line segment and previous line segment nearly overlap, the lines (better: the corners) will get "oversized".

In my screenshots i move the red point in the arrow direction and the lines/corners will get "oversized".

How can i avoid this?

Best regards,
Tim

situation_1.jpg

 

situation_2.jpg

Edited by TimT77
Change second image to better display the problem

Share this post


Link to post
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...

  • Recently Browsing   0 members

    No registered users viewing this page.