This Lesson covers polygons. A polygon must have at least 3 points (triangle). Basically it takes an array of x,y points, an integer (number of points), and color. |
$points = array(50,10,10,90,90,90);
imagefilledpolygon($image,$points,3,$red);
|
|
A 3D box:
|
|
Hexagon: This line seems to make the lines sharper.
ImageAntiAlias($im, true);
|
Uses imagefilledpolygon and imagepolygon for the outlines.
|
This octogram is made up of 4 triangles (different colors so you can see them).
|
|
|
|
|
One of Mike's scripts which he gave me.
Star Text |
| Another star from Mike's site.
Star Gradient
You can visit his site here:
DJ Mike
If you get a message about risky behavior on his site, it is probably because he banned all the foreign countries. It is safe to visit.
|
This is a script I found on line a while back. Reload the page to see the image change.
Polygon Fractal | Frac_Gen Zip |
This is a script I found on line years ago. It does not appear to be on line anymore.
Polygon Form | Polygon zip |
| If you just want to output an image without the form or the writing on it, grab this text, which is the same script as the polygon form with the extras commented out.
Polygon Text
|
Finally, this is a page I did a few years back experimenting with Loops and Polygons.
|