Changing Width of Render Line


#1

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.


#2

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.


#3

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.


#4

Thanks mikefinch.

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


#5

Hey Max,

U can consider adding this feature in next version…


#6

+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?


#7

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.


#8

I found this article very useful for our subject.


#9

I was also looking to increase width of renderLine.

It would be great if there is snippet of it…

Thanks in Advance…