Location: PHPKode > projects > PHP Cad and Drawing Program > functions/light.inc
AAAAAAAAAAAAAAAAAAAAAAAAA
//
//  ** Text Editor ** 3D
//  direction, l,r,u,d, height in feet,
//  on = on,off either light on or light off
//  pole = will make a lamp post with light up.
//
function light($image,$direction,$height,$on,$pole,$scale,$x,$y) {
    $zcolor = ImageColorAllocate($image,0,0,0);
    $x=$x*$scale;
    $y=$y*$scale;
    $radius=.5*$scale;
    for($i=0; $i<=$radius; ++$i) {
        ImageArc($image,$x,$y,$i,$i,0,360,$zcolor);
    }
}
BBBBBBBBBBBBBBBBBBBBBBBBBBBB
CCCCCCCCCCCCCCCCCCCCCCCCCCCC
function light($image,$direction,$height,$on,$pole,$scale,$x,$y)
{
    global $zz;
if ($direction=="L") $z="<0,0,270>";
if ($direction=="R") $z="<0,0,90>";
if ($direction=="U") $z="<270,0,0>";
if ($direction=="D") $z="<90,0,0>";
if ($direction=="POLE") $z="<0,0,0>";

if ($direction=="L") $t="<$x-.35,$height,$y>";
if ($direction=="R") $t="<$x+.35,$height,$y>";
if ($direction=="U") $t="<$x,$height,$y-.35>";
if ($direction=="D") $t="<$x,$height,$y+.35>";
if ($direction=="POLE") $t="<$x,$height+.35,$y>";

$ot="
object { Light($on, yes)
rotate $z
translate $t }
";
fwrite($zz,$ot);
if ($direction=="POLE")
    {
$ot="
cylinder { <$x,0,$y>, <$x,$height,$y>, 0.1
texture { T_Brass_1C } }
";
    fwrite($zz,$ot);
    }
}
DDDDDDDDDDDDDDDDDDDDDDDD
$inthemenu = "no";
$dirlist= array("NA");
$lenlist= array("NA");
$txtitem="AAAAAA";
EEEEEEEEEEEEEEEEEEEEEEEEEEEEE
Return current item: PHP Cad and Drawing Program