Perform fast polygon drawing
From observation of the list traffic there would seem to be several members interested in 3D graphics, and therefore in fast polygon-drawing. As a recent disciple of this topic I have experimented with ways of speeding up PAINTPOLY. The normal method of painting a triangle (see FN PaintTriangle below) requires 8 QuickDraw calls. A small optimisation reduces this to 7, by not "closing" the triangle -- closure is needed for FRAMEPOLY, but not for PAINTPOLY.
A more substantial speedup is shown in FN FastPaintTriangle, where the polygon information is poked into a pre-existing handle, thus reducing the overhead -- but not of course the time actually required for PAINTPOLY to do its drawing. In a typical 3D graphics application, involving the painting of about 3000 small triangles, my frame rate was nearly doubled by this simple trick.
Considerably more speed can be obtained from a custom PaintPoly routine. My current attempt uses a mixture of FB and assembler; it paints triangles and larger polygons, but is depressingly complicated and fails on many types of convex polygon. Does anyone have a contribution to this holy grail?
COMPILE ,_dimmedvarsOnly LOCAL FN FastPaintTriangle(pt0&,pt1&,pt2&,triangleH&) 'accelerated PAINTPOLY; pt0& etc are pointers to points DIM rect.0,ymin,xmin,ymax,xmax' bounds rect rect.topLeft&;4=pt0&: rect.botRight&;4=pt0& IF pt1&.v%