I did a program like that where points would move inside a rectangle, like balls in a pool table. If I correctly understood, you have user draw lines with different angles than the horizontal and vertical lines of the rectangle. It´s all math like Wysota said, but if you think it can help you, I can try to find my code and show you, but it's old and made in MFC6 with opengl.
Bookmarks