I aim to create 3D lines that provide the unit measurement of said line on the line. I've already gotten the line and text to render, but I want some way to lock the text's rotation to the line and have it face the player. I've tried to use the player's Pitch and Yaw rotation to have the text face them; however, rotating it that way causes it to overlap nearby measurement units easily. In addition, I'd also need to tell if the player is in front or behind the line's face to flip the rendered text. I've experimented with rotating vectors around matrixes with little luck. Either I am not doing it right, or the method I used isn't the solution. If anyone has any suggestions, please let me know. I am at my witts end. What I have thus far
I've tried to get the point that is perpendicular to the midpoint so I could get the angle from the midpoint, perpendicular point, and the player camera. Then, with the angle, I could rotate the text. But each time I tried different solutions I found on this site and others, they never seemed to stay consistently perpendicular to the line. It would work when the line had a direction vector of 1,0,0, but as soon as the y or z-axis had a shift, it broke.