Talk About Network

Google


Register and Login
Nick
Password
Register create new account Sign up is FREE and you can post replies, new topics, bookmark posts and more!
Recover lost password


Gaming > Development Programming Algorithms > Re: Altitude of...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 9 of 17 Topic 581 of 679
Post > Topic >>

Re: Altitude of a point in a triangle

by Tom Plunket <gamedev@[EMAIL PROTECTED] > Sep 21, 2006 at 04:26 PM

Erik Max Francis wrote:

> > And again, sorry if I'm being unclear.  I normally try to be pretty
good 
> > about this stuff, but I guess I'm very tired this week, as I've caught

> > myself asking a couple of questions that just turned out to be silly 
> > bugs on my part.  I'll be more careful, going forward.
> 
> The vector solution for this, by the way, would be to write out the 
> vector equation of the plane:
> 
> 	{x: (x - p) dot n = 0},

If you want to determine the distance from a point to a triangle along a
given vector, this is most certainly not the correct solution.  Miss
Elaine was looking for where the Y-down vector intersected the triangle,
regardless of the triangle's normal.

....which makes me realize that the problem can be a lot simpler than I
previously was making it out to be...

In short, compute the distance from the point to the plane (as Erik
provides above).  Divide that distance by the dot product of the normal
with the "down" vector (e.g. { 0, -1, 0 }).  Scale the "down" vector by
that scaled distance.  Note that this doesn't validate that the point is
over the triangle; as this is a "distance to plane" function, you've
still got to do your own rejection if the point isn't within any
triangle.  You can sanity-check by dotting this new "altitude vector"
with the triangle's normal, and you should get back the
distance-to-plane that you computed earlier.

....I think.  ;)

-tom!

--
 




 17 Posts in Topic:
Altitude of a point in a triangle
Miss Elaine Eos <Misc@  2006-09-14 17:10:54 
Re: Altitude of a point in a triangle
Erik Max Francis <max@  2006-09-14 13:24:04 
Re: Altitude of a point in a triangle
Miss Elaine Eos <Misc@  2006-09-14 23:04:33 
Re: Altitude of a point in a triangle
Erik Max Francis <max@  2006-09-14 17:01:36 
Re: Altitude of a point in a triangle
"Alfie [UK]" &l  2006-09-15 02:04:43 
Re: Altitude of a point in a triangle
Erik Max Francis <max@  2006-09-15 13:49:39 
Re: Altitude of a point in a triangle
Miss Elaine Eos <Misc@  2006-09-15 01:12:41 
Re: Altitude of a point in a triangle
Erik Max Francis <max@  2006-09-15 13:49:09 
Re: Altitude of a point in a triangle
Tom Plunket <gamedev@[  2006-09-21 16:26:51 
Re: Altitude of a point in a triangle
Erik Max Francis <max@  2006-09-22 15:22:10 
Re: Altitude of a point in a triangle
Tom Plunket <gamedev@[  2006-09-23 19:12:17 
Re: Altitude of a point in a triangle
Erik Max Francis <max@  2006-09-23 19:22:19 
Re: Altitude of a point in a triangle
Tom Plunket <gamedev@[  2006-09-24 12:54:02 
Re: Altitude of a point in a triangle
Erik Max Francis <max@  2006-09-24 21:33:53 
Re: Altitude of a point in a triangle
Tom Plunket <gamedev@[  2006-09-25 14:28:47 
Re: Altitude of a point in a triangle
Erik Max Francis <max@  2006-09-25 15:58:10 
Re: Altitude of a point in a triangle
Miss Elaine Eos <Misc@  2006-09-15 01:04:18 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
tan12V112 Fri Jul 18 19:37:52 CDT 2008.