This program was an exercise in calculating, and clipping lines if they did not fall within a boundary box. The basic instructions for this program was to have the program randomly draw up to 5 triangles on the screen, and if they were not located inside of the box, they would be "clipped."
I decided that instead of merely just not drawing the portions outside of the boundary box, I would instead draw them in a monochrome color. This both shows how the original triangle was laid out, and what sections of the triangle are located outside of the box.
Click this link to use the program. Click on the screen to make it draw one triangle at a time.
The source code is located here.
Animation Project
16 years ago
The triangles were way cool! Each time I loaded the program it would make completely different ones for me. I didn't expect that at all. I thought they would be the same
ReplyDelete