Best way to draw dashed lines/curves in 3D

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By HarpyEagle

Hi, I have a project where a lot of the GUI will consist of lines drawn in 3D. These in include straight lines as well as elliptical and parabolic curves (think celestial orbits).

There will be lots of different lines so I don’t want to have to differentiate them with color alone, but also be able to vary line thickness and use dashed/dotted lines.

I’ve looked into using Immediate Geometry to draw lines, but it seems very limited. For one, while I am able to change the emission color using a material, I cannot figure out a way to vary the length of the lines.

Furthermore, the only way to draw dashed lines with Immediate Geometry seems that you need to create an node for every single dash. I am worried that this will not scale, both in terms of performance, and literally, the dash pattern does not scale if the camera zooms out, instead becoming hard to see.

I need to use 3D curves as I want to render elliptical lines while allowing the user to orbit the camera around to see them from different angles. What is the right approach here? Is Godot the right tool for this job, or should I consider something else?