Changing Width of Render Line

Hello Team,

I am using this.app.renderLine() function for drawing the line between the two given points. Please let me know how to increase the width of the line.

1 Like

I’m not sure, but we have this construction

There you can play with lineType attribute. However, I didn’t find documentation about this constants.

But i suppose the simplest way is create new mesh, for example cube and position it’s vertexes on start and end of line.

You can specify offset for vertex around your start and end points and variable this value to increase line’s width.

lineType only defines which Layer it will draw line over. That is good if you want to make lines to interact with world or not.

Thanks mikefinch.

I did it using simple cylinder and place it between two points and scale it appropriately…

Hey Max,

U can consider adding this feature in next version…

1 Like

+1

What do you think about create 4-vertex mesh, place vertexes in start and end points and draw this sh… mesh.
This way do don’t need to scale it and it uses less of memory. Huh?

Looking at WebGL functionality, it seems like width other than 1.0 is supported by less than 10% of platforms.
So basically even if we expose ability to set width, it will not render it properly in most cases.
For example Windows only does line width 1.0.
While OSX does 7px guaranteed, but then goes not guaranteed till 64px line width.
Then mobile is pretty good till 8px, but then goes uncertain again, with big differences between iOS and Android.

So not sure line width using native way - is the way to go.
If you need “fat” line, then you better to do it with cylinders or so.

1 Like

I found this article very useful for our subject.

3 Likes

I was also looking to increase width of renderLine.

It would be great if there is snippet of it…

Thanks in Advance…