The "Freeola Customer Forum" forum, which includes Retro Game Reviews, has been archived and is now read-only. You cannot post here or create a new thread or review on this forum.
$values = array(
0 => $a_x, // x1
1 => $a_y, // y1
2 => $b_x, // x2
3 => $b_y, // y2
4 => $c_x, // x3
5 => $c_y, // y3
6 => $d_x, // x4
7 => $d_y, // y4
);
$im = imagecreate(500, 500);
$bg = imagecolorallocate($im, 255, 255, 255);
$blue = imagecolorallocate($im, 0, 0, 255);
imagefilledpolygon($im, $values, 4, $blue );
?>
But surprise, surprise, it doesn't work for me. I don't get any error messages though. Any ideas?
The snippet you posted does work, but remember you need to set
header ("Content-type: image/gif");
at the start of the php code. And of course, make sure you're calling the php script from within an image tag.
Although that was just regular squares, so it's much simpler.
GD Support - enabled
GD Version - 2.0 or higher
FreeType Support - enabled
FreeType Linkage - with freetype
GIF Read Support - enabled
GIF Create Support - enabled
JPG Support - enabled
PNG Support - enabled
WBMP Support - enabled
Yip, it's all there.
PNG IHDRMPLTEx<IDATx
ձm0P%*Tjl&Q,p{O-_||c
-_#[Dp_o, > X
wK=SGXJ21#Z@0r x֒
k*] D)QV~KK]z h8
]W"sjR@ʽ{[*?^a̭?
Very strange. I hope that big mess doesn't hold any valuable information!
OK, it now looks like this:
$values = array(
0 => $a_x, // x1
1 => $a_y, // y1
2 => $b_x, // x2
3 => $b_y, // y2
4 => $c_x, // x3
5 => $c_y, // y3
6 => $d_x, // x4
7 => $d_y, // y4
);
$im = Imagecreate(500, 500);
$bg = ImageColorAllocate($im, 255, 255, 255);
$blue = ImageColorAllocate($im, 0, 0, 255);
ImageFilledPolygon($im, $values, 4, $blue );
ImagePng ($im);
ImageDestroy ($im);
?>
But all I get is a load of gibberish code.
http://www.pocketmonkey.co.uk/3D_box/
It's not *true* 3D, but it gives the impresion pretty good. And it only works in IE because of the layers and stuff.
$values = array(
0 => $a_x, // x1
1 => $a_y, // y1
2 => $b_x, // x2
3 => $b_y, // y2
4 => $c_x, // x3
5 => $c_y, // y3
6 => $d_x, // x4
7 => $d_y, // y4
);
$im = imagecreate(500, 500);
$bg = imagecolorallocate($im, 255, 255, 255);
$blue = imagecolorallocate($im, 0, 0, 255);
imagefilledpolygon($im, $values, 4, $blue );
?>
But surprise, surprise, it doesn't work for me. I don't get any error messages though. Any ideas?