I have one line (two point (x,y) (x1,y1)) and a rectangle with focus point (rx,ry). I need help to find out collision point between line and rectangle, an example in C++ wil
Theres a lot of information out there about interectioning shapes. http://www.geometrictools.com/LibFoundation/Intersection/Intersection.html is probably a very good starting spot. In fact it contains C++ code for line-rectangle intersection. And its by Dave Eberly who is fairly well known in the computer graphics world.
Having said that what I'd do if I needed my own algorithm is something like this:
This should work for arbitrary polygons. And so rotated rectangles wont be a problem.
If you need to speed things up a bit you can improve the rejection criteria in 3, by using axis-aligned bounding rectangles for the line segment and the rectangle.