Infinite Line and Homogeneous Coordinates


I’m working on a visualization system, designed to show a special geometry that deals with homogeneous coordinates.

As a result, I need to be able to draw infinite lines, such that you cannot see its end even if you pan, zoom or orbit around it.

My first attempt was to use glVertex passing tuples like ( x, y, z, w ) with w = 0. The line is drawn on the screen but with a finite extend. After zooming back a log way, it is possible to see both of its ends.

This geometry I’m working, specially deals with w < 0. But, since I know that not all OpenGL implementations can handle w < 0, I’m limiting myself in w >= 0.

Does anybody know any technic to draw (or at least pretend to draw) infinite lines?

Thanks a lot,


It is possible to see the projected ‘end’ of an infinite line if you look in the direction of it’s vanishing point (every straight line will have two vanishing points in opposite directions). It is actually pretty common to encounter this with a perspective projection.

Well, I didn’t know that.
I was expecting a behavior like a line that is always crossing the screen, except if you look by its “side”, in a way that you just see a point.



You always have the 6 planes of the projection… ive heard that you can move the backplane to infinity, but not the near plane. Perhaps the nvidia exension depth_clamp helps for that.