ScratchData LogoScratchData
Back to chooper-beta's profile

Triangle Clipping Challenge

CHchooper-beta•Created August 17, 2016
Triangle Clipping Challenge
58
35
1108 views
View on Scratch

Instructions

Move the mouse around Press space to begin testing After the final test, stress tests are performed, alternating between drawing 200 clipped triangles and 200 non-clipped triangles

Description

Clips triangles to a given rectangle The clipped triangle is made by the division of the original triangle into smaller ones Credit to @TheLogFather for his hybrid triangle filler I used CHALLENGE: Can you make a faster clipping algorithm that satisfies all the tests? Have a go, and if you can make an algorithm faster than the one shown here, I'll give you a follow from @chooper100 (or something equivalent) RULES: You must provide 2 blocks: - fill triangle (Ax) (Ay) (Bx) (By) (Cx) (Cy) res (res) - clip and fill triangle (Ax) (Ay) (Bx) (By) (Cx) (Cy) res (res) The testing code must not be changed The outline of the original triangle and the clipping area must also be visible and they must be easy to distinguish from the clipped triangle You may change the algorithm used to draw triangles if you have a more efficient algorithm You may also remove the "Triangles Drawn" variable. The "Test Time" variable must be kept however

Project Details

Project ID118500870
CreatedAugust 17, 2016
Last ModifiedSeptember 2, 2016
SharedAugust 18, 2016
Visibilityvisible
CommentsAllowed