Location: PHPKode > projects > PHP Cad and Drawing Program > functions/dddgrasspatch.inc
AAAAAAAAAAAAAAAAAAAAAAAAA
//
//  ** Text Editor **  2D, 3D
//  Requires Beizer.inc and Grasspatch.inc
//  maxbladeheight = height of blade
//  minblade height = minimum height of blade
//  x,y lower right, u,v, upper left.
//
function DDDgrasspatch($image, $maxbladeheight, $minbladeheight, $u, $v, $scale, $x, $y)
{
   $green = ImageColorAllocate($image,0,255,0);
   $x = $x * $scale;
   $y = $y * $scale;
   $u = $u * $scale;
   $v = $v * $scale;
   ImageFilledRectangle($image,$x,$y,$u,$v,$green);
}
BBBBBBBBBBBBBBBBBBBBBBBBBBBB
if ($PObj == "dddgrasspatch") {
    if ($xx !="" and $yy !="" and $u !="" and $v !="") {
        if ($xx > $u) {
            $sw = $u;
            $u = $xx;
            $xx = $sw;
        }
        if ($yy > $v) {
            $sw = $v;
            $v = $yy;
            $yy = $sw;
        }
        $a=fopen("./files/$pfilez", "a");
        $xp = "<?php " . $PObj . "($" . "image,";
        $xp .= '4,';
        $xp .= '2,';
	$xp .= $u . "," . $v . ",";
        $xp .= "$" . "scale," . $xx . "," . $yy . "); ?>\n";
        $yy++;
        fwrite($a, $xp);
        fclose($a);
    }
}
CCCCCCCCCCCCCCCCCCCCCCCC
function DDDgrasspatch($image, $maxbladeheight, $minbladeheight, $u, $v, $scale, $x, $y)
{
global $zz;
    $ot=
"// Blade_Heights are in standard POV units
#declare Blade_Height_Minimum = $minbladeheight;
#declare Blade_Height_Maximum = $maxbladeheight;

#declare someseed = seed(10000);

// Requires grasspatch.inc for a patch of grass put in appropriate directory.
#declare Patch_Shape = 1; // Square
#declare Patch_X_Minimum = $x;
#declare Patch_X_Maximum = $u;
#declare Patch_Z_Minimum = $y;
#declare Patch_Z_Maximum = $v;
PlantPatch()";
        fwrite($zz,$ot);
}
DDDDDDDDDDDDDDDDDDDDDDDD
$inthemenu = "yes";
$dirlist= array("NA");
$lenlist= array("2-4");
$txtitem="AAAAAA";
EEEEEEEEEEEEEEEEEEEEEEEEEEEEE
Return current item: PHP Cad and Drawing Program