realbasic-games
[Top] [All Lists]

Re: line segment/triangle intersection in 3D

To: REALbasic Games <realbasic-games at lists dot realsoftware dot com>
Subject: Re: line segment/triangle intersection in 3D
From: Joe Raffanti <joeraffanti at accessbee dot com>
Date: Fri, 19 Aug 2005 17:27:17 -0700
Delivered-to: realbasic-games at lists dot realsoftware dot com
References: <a06200700bf2ac5f97ad1 at [66 dot 81 dot 214 dot 250]> <a06200715bf2b9c5dd723 at [10 dot 0 dot 1 dot 2]>
Thanks for all the feedback, everyone.
I think this is what you were referring to in Renegades:

Function PlaneIntersection(planeNormal As Vector3D, planeD As Double, p0 As Vector3D, p1 As Vector3D) As Vector3D
   // Find the intersection of the line from p0 to p1 with the given plane.
// See Lengyel p. 85. Dim t As Double
   Dim V As Vector3D
V = p1.Minus(p0)
   t = -(planeNormal.dot(p0) + planeD) / (planeNormal.Dot(V))
   return p0.Plus(V.Times(t))
End Function

This looks like the right thing, but what does planeD refer to? ...I assume it is plane Depth or something like that, but then what do I measure the depth from? How would I set up the plane?

thanks,
Joe Raffanti

At 4:14 PM -0700 8/18/05, Joe Raffanti wrote:

Has anyone written a RB line segment / triangle intersection detection test?

I think there's one in Renegades, or in its precursor, the FPS demo described in RB Developer issue 1.3.

If so, could I use it?

Sure, help yourself. If that doesn't do what you need, then do a search for "Paul Bourke Geometry" -- Paul is an astronomer in Australia who has a ton of amazingly useful tutorials for this sort of thing.

Best,
- Joe

--
Joe Strout                          REAL Software, Inc.

Vote for REALbasic (twice!) in the LinuxWorld Reader's Choice Awards:
http://linux.sys-con.com/general/readerschoice.htm
_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>

Search the archives of this list here:
<http://support.realsoftware.com/listarchives/lists.html>

_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>

Search the archives of this list here:
<http://support.realsoftware.com/listarchives/lists.html>

<Prev in Thread] Current Thread [Next in Thread>