PDA

View Full Version : Infinite Line and Homogeneous Coordinates



Pakk
05-18-2004, 01:07 PM
Hi,

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,

Pakk

dorbie
05-18-2004, 03:11 PM
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.

Pakk
05-19-2004, 04:59 AM
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.

Thanks,

Pakk

Mazy
05-19-2004, 05:47 AM
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.