General Development

Intersecting Ray or against Convex Polyhedron – Calin

Calin

Member

Posts: 358
From: Moldova
Registered: 12-04-2006
Could someone help me figure out how to solve this. I have a ray and a square in the same plane and I need to find out when the ray 'punches' the square.

Thanks

Ups, I made a mistake in the tile and I can't fix it.

------------------
Nanostorm: Machine Uprise

[This message has been edited by Calin (edited August 27, 2007).]

samw3

Member

Posts: 542
From: Toccoa, GA, USA
Registered: 08-15-2006
I think dartsman would know how to do this. But I could take a stab at it..

Is the ray defined by two points or one point and angles?

What are you trying to do with these? Could this be simplified with a ray-sphere collision (i.e. 3d distance formula)?


------------------
Sam Washburn

Check out my CCN SpeedGame 2 Blog

[This message has been edited by samw3 (edited August 27, 2007).]

HanClinto

Administrator

Posts: 1828
From: Indiana
Registered: 10-11-2004
Would this faq be of service?

It doesn't answer your exact question, but the answer to question 1.03 looks like it has some useful hints.

--clint

Calin

Member

Posts: 358
From: Moldova
Registered: 12-04-2006
quote:
Originally posted by samw3:
I think dartsman would know how to do this. But I could take a stab at it..

Is the ray defined by two points or one point and angles?

What are you trying to do with these? Could this be simplified with a ray-sphere collision (i.e. 3d distance formula)?


The ray is defined by two points and it can be simplified to a ray-sphere collision

Thanks Clint I'll look at that FAQ

------------------
Nanostorm: Machine Uprise

[This message has been edited by Calin (edited August 28, 2007).]

samw3

Member

Posts: 542
From: Toccoa, GA, USA
Registered: 08-15-2006
Here are a couple links for you

Ray-Sphere intersection algorithms:

http://www.siggraph.org/education/materials/HyperGraph/raytrace/rtinter1.htm

http://www.ccs.neu.edu/home/fell/CSU540/programs/RayTracingFormulas.htm

------------------
Sam Washburn

Check out my CCN SpeedGame 2 Blog