I won’t post the entire code here, because it’s pretty damn ugly. But here’s what I ended up doing:
- I used the
gluunproject
statement to find the beginning and end points to extrapolate a line from.
- Now that I have a line, I use the formula provided by Wikipedia using the vector formulation of the line.
- Simply do a loop over the vertices and find the minimum.
Sorry for note posting recently… I got caught up in things… 🙁