Make billboard line in world-space

Hi folks,

to keep a project alive I’m working on for a long time, I need to create a line in world-space from a list of world locations by making a line segment mesh between consecutive locations.

I’m calculating the normal between consecutive points n and get the view direction of the camera v. By extruding each location inside and ouside along direction n x v (the direction perpendicular to both view and line direction) we get two points. In total we get a strip of quadrilaterals and a line that always faces the camera. That is working.

Additionally, I’m also trying to let the line appear (in the camera) to have the same width no matter the angle or distance to the camera.

My idea was to just scale the extrusion depending on the distance to the camera plane of the points, but that does only work for a top-down perspective (left). At more narrow camera angles the line gets thinner and thinner and finally disappears (right).

I don’t see the reason why it does not work for any angle!

Below the blueprint when we use that in a custom function “Create Output Mesh“ combined with a Procedural Mesh component.