When I use the orthogonal mode of ArcrotateCamera to zoom the screen, when zoomed to a certain extent, the graphics created by CreateLines will appear very crowded and even wider than CreateGreasedLine. What is the reason for this and how to modify it.
I started to write it because we needed to visualize pipes and electrical wiring in our digital twins and there are tens of thousands of lines even in a smaller building with various widths/colors, we can show water flow in pipes using animating the dash of the lines, so quite cool. BUT it actually looks very good only when using thinner lines. When people started to draw thick lines I realized that the joints must be improved because it looks like shit.
The lines are thinner at joints (or thicker, depends on the angle)
I’m pretty curious why don’t anyone complain about it I believe it can be fixed quite easily by adding some more vertices at the joints so I’ll give it a try just right I’ll have some extra time. One of my friends gave me a very good advice: sleep faster LOL
GreasedLine for the first line to achieve thickness and 1px thick line with edge rendering to make it thicker. Unfortunatelly you can’t compare them. Choose the one which fits your needs better.
GreasedLine has a feature called sizeAttenuation which you might want to use to get always the same width.
I am not aware of your goals. If you could explain what do you want to achieve we can help you to choose the right babylon.js feature.
Why do you stick to the EdgeRenderer and just don’t use GreasedLine ?
If there is a reason actually you can change the edgesWidth according to camera.radius in the render loop so you basically:
It’s like this, In the previous historical code, edgesWidth was used to create a line with width.
After recently setting up orthogonal mode, lines created using edgesWidth will have some display differences (initial question).
I found a way to use onBeforeRenderObservable in the forum. And i’m looking for if there’s a simpler way like sizeAttenuation that sets the attribute directly.
At present, it seems that it should be the design of Babylon.
I will use onBeforeRenderObservable or GreasedLine to modify the historical code.