line-poly/line-line intersections...
How would I go about checking for line-line or line-poly intersections? This is for collision detection (only after checking for bounding sphere collisions of course). Detecting collisions between a line and polygon is my priority, but I also need line-line intersection for another 3D app with only 2D interaction.
Morgan
Look here http://www.swin.edu.au/astronomy/pbourke/geometry/
Nate
http://nate.scuzzy.net
Nate
http://nate.scuzzy.net
Thanks, Nate! By the way, your normals doc helped me out a lot, but I was surprised that you didn''t include the code for doing the cross product (not everybody knows this).
Morgan
Morgan
struct VERTEX
{
float x,y,z;
};
void crossproduct(VERTEX v1,VERTEX v2,VERTEX *dest)
{
dest->x = v1.y*v2.z - v1.z*v2.y;
dest->y = v1.z*v2.x - v1.x*v2.z;
dest->z = v1.x*v2.y - v1.y*v2.x;
}
I hope this helps you.
Visit our homepage: www.rarebyte.de.st
GA
Edited by - ga on May 21, 2000 5:53:44 AM
Visit our homepage: www.rarebyte.de.stGA
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement
Recommended Tutorials
Advertisement