|
-
Jan 12th, 2006, 10:25 PM
#1
Thread Starter
Frenzied Member
Please help me with this function
I'm pretty sucky at C/C++ and math, so I need some help with this function:
http://www.acm.org/jgt/papers/Moller...re97/code.html
The function should check if a line intersects a triangle...
Now the problem is that I don't know exactly how to call this function...
Should all the points be [x,y,z]?
Is dir[] a point in space or what?
(Sorry for double posting)
-
Jan 13th, 2006, 07:37 AM
#2
Re: Please help me with this function
From the names it seems that:
- orig is the origin of the line, dir is its direction.
- vert0..2 are the corners of the triangle
- all points should be [x,y,z], but the function itself doesn't care which order you put the components in (they are all treated the same), as long as it is consistent.
- t will contain the time of intersection along the line. The intersection point will be orig + t * dir
If you have a line between p0 and p1, choose orig = p0 and dir = p1 - p0
-
Jan 13th, 2006, 03:18 PM
#3
Thread Starter
Frenzied Member
Re: Please help me with this function
Ok... Sounds about right! I'll try that!
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|