|
|
|
|
![]() ![]() |
May 7 2005, 12:56 AM
Post
#1
|
|
|
Privileged Member ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Group: Members Posts: 629 Joined: 26-February 05 Member No.: 3,995 |
I've been experimenting a little with PHP's image functions and I was trying to see if I could make something that looked 3D, so I started with a cube because it's simple. To make an isometric picture of a cube, you need to start with a regular hexagon. However, making a regular hexagon isn't the easiest thing. Is there a function to create a regular polygon, or specify an angle and magnitude for a vector?
|
|
|
|
May 8 2005, 01:57 AM
Post
#2
|
|
|
Privileged Member ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Group: Members Posts: 629 Joined: 26-February 05 Member No.: 3,995 |
Done a little copying recently?
http://www.phpbuilder.com/columns/cash20030526.php3 This post has been edited by snlildude87: May 8 2005, 02:07 AM |
|
|
|
May 8 2005, 01:23 PM
Post
#3
|
|
|
Owner of Sub-Zero ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Group: Members Posts: 159 Joined: 17-November 04 Member No.: 2,325 |
PHP has image editing functions?! >_>; I never even knew that. I mean, I knew it had tons of mail functions and all that good stuff but never image editing functions. The most recent thing that I have learned that have to do with shapes is something that you add in CSS. It's like this:
CODE -moz-border-radius: #px; I had no idea you could edit pictures with PHP... |
|
|
|
May 9 2005, 08:01 AM
Post
#4
|
|
|
Advanced Member ![]() ![]() ![]() ![]() ![]() ![]() ![]() Group: Members Posts: 113 Joined: 14-January 05 From: Philippines Member No.: 3,271 |
with the GD module loaded as a PHP extension, PHP gains image-editing functions.
|
|
|
|
May 10 2005, 12:49 AM
Post
#5
|
|
|
Privileged Member ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Group: Members Posts: 629 Joined: 26-February 05 Member No.: 3,995 |
Yeah, you can do stuff but it's pretty complicated. Here's an example:
http://www.tjhsst.edu/~tsmilack/tests/image.php The code is: CODE <?php
header("Content-type: image/png"); $img = imagecreate(500,500); $topleft = imagecolorallocate($img,255,0,0); $bottomright = imagecolorallocate($img,255,255,0); $topright = imagecolorallocate($img,0,0,255); $bottomleft = imagecolorallocate($img,0,255,0); $middle = imagecolorallocate($img,255,0,255); $border = imagecolorallocate($img,0,0,0); $diamond = imagecolorallocate($img,255,128,0); imagefilledrectangle($img,0,0,250,250,$topleft); imagefilledrectangle($img,250,0,500,250,$topright); imagefilledrectangle($img,0,250,250,500,$bottomleft); imagefilledrectangle($img,250,250,500,500,$bottomright); imagefilledrectangle($img,125,125,375,375,$middle); $points = array(125,250,250,125,375,250,250,375); imagefilledpolygon($img,$points,4,$diamond); imagerectangle($img,0,0,499,499,$border); imagepng($img); imagedestroy($img); ?> |
|
|
|
![]() ![]() |
Similar Topics
|
Lo-Fi Version | Time is now: 13th October 2008 - 04:56 PM |