Hi, I know this is Blitz 3D specific, but I couldn't see a 2D specific forum.
I have X & Y co-ords for each end of a line; an X & Y coord and a Height & Width value for a rectangle. I want to draw the line, but only the portion that is inside the rect (if any). So I need two new XY coords for the line.
I could do loads of nested If... Thens checking each point against all others but I'm sure there must be a quite simple formula/equation to determine the two new endpoints quite neatly. But I can't think of it. Anyone know one offhand?
I have X & Y co-ords for each end of a line; an X & Y coord and a Height & Width value for a rectangle. I want to draw the line, but only the portion that is inside the rect (if any). So I need two new XY coords for the line.
I could do loads of nested If... Thens checking each point against all others but I'm sure there must be a quite simple formula/equation to determine the two new endpoints quite neatly. But I can't think of it. Anyone know one offhand?