Image_3D
[ class tree: Image_3D ] [ index: Image_3D ] [ all elements ]

Source for file spotlights.php

Documentation is available at spotlights.php

  1. <?php
  2.  
  3. require_once('Image/3D.php');
  4.  
  5. $world = new Image_3D();
  6. $world->setColor(new Image_3D_Color(255255255));
  7.  
  8. $light $world->createLight('Light'array(-2000-2000-2000));
  9. $light->setColor(new Image_3D_Color(255255255));
  10.  
  11. $redSpot $world->createLight('Spotlight'array(00-200'aim' => array(0-250)'angle' => 30'float' => 2));
  12. $redSpot->setColor(new Image_3D_Color(25500));
  13.  
  14. $blueSpot $world->createLight('Spotlight'array(00-200'aim' => array(-35250)'angle' => 30'float' => 2));
  15. $blueSpot->setColor(new Image_3D_Color(00255));
  16.  
  17. $greenSpot $world->createLight('Spotlight'array(00-200'aim' => array(35250)'angle' => 30'float' => 2));
  18. $greenSpot->setColor(new Image_3D_Color(02550));
  19.  
  20. $map $world->createObject('map');
  21.  
  22. $detail = 80;
  23. $size = 200;
  24. $height = 40;
  25.  
  26. $raster = 1 / $detail;
  27. for ($x = -1; $x <= 1; $x += $raster{
  28.     $row = array();
  29.     for ($y = -1; $y <= 1; $y += $raster{
  30.         $row[= new Image_3D_Point($x $size$y $sizesin($x pi()) sin($y * 2 * pi()) $height);
  31.     }
  32.     $map->addRow($row);
  33. }
  34.  
  35. $map->setColor(new Image_3D_Color(1501501500));
  36.  
  37. $world->transform($world->createMatrix('Rotation'array(-2010-10)));
  38.  
  39. $world->createRenderer('perspectively');
  40. $world->createDriver('GD');
  41. $world->render(400400'Image_3D_Spotlights.png');
  42.  
  43. echo $world->stats();

Documentation generated on Mon, 11 Mar 2019 15:48:14 -0400 by phpDocumentor 1.4.4. PEAR Logo Copyright © PHP Group 2004.