🎉 Celebrating 25 Years of GameDev.net! 🎉

Not many can claim 25 years on the Internet! Join us in celebrating this milestone. Learn more about our history, and thank you for being a part of our community!

line-poly/line-line intersections...

Started by
3 comments, last by Morgan 24 years, 1 month ago
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
Advertisement
Look here http://www.swin.edu.au/astronomy/pbourke/geometry/

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

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
Actually, I already had it (my new lighting code, thanks to Nate, has been running for a few days now). I was just surprised that he didn''t include it.

Morgan

This topic is closed to new replies.

Advertisement