On Mon, 28 Jan 2013 12:17:50 -0600, Bint wrote:
> But if I were to do that in 3D, the polygons comprising a line would form
> a flat ruler shape, and it would change depending on the angle I looked at
> it. I was thinking I might be able to get it to work by rotating the
> polygons to face the camera. Has anyone done that? Will it work to achieve
> what I want?
Personally, I'd do this in the geometry shader, after the coordinates have
been transformed to screen space.
The main problem with doing it in model space is that the offset needs to
vary with distance in order to get a constant thickness in screen space.
Also, if one of the endpoints is closer to the vanishing point than half
the line thickness, the polygon would have to extend beyond infinity. But
that's an issue even if you do it in screen space. The solution is to fold
the endpoints out so that they're perpendicular to the projection plane.