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

Source for file pointlight.php

Documentation is available at pointlight.php

  1. <?php
  2.  
  3. require_once('Image/3D.php');
  4.  
  5. $world = new Image_3D();
  6. $world->setColor(new Image_3D_Color(250250250));
  7.  
  8. $light $world->createLight('Point'array(0-2000'distance' => 300'falloff' => 2));
  9. $light->setColor(new Image_3D_Color(150150255));
  10.  
  11. $steps = 10;
  12. $step = 20;
  13.  
  14. for ($i = 0; $i $steps; ++$i{
  15.     $y ($steps $step / -2$i $step;
  16.     $p $world->createObject('polygon'array(new Image_3D_Point(-100$y-30)new Image_3D_Point(-100$y50)new Image_3D_Point(100$y40)));
  17.     $p->setColor(new Image_3D_Color(255255255));
  18. }
  19.  
  20. $world->transform($world->createMatrix('Rotation'array(2000)));
  21.  
  22. $world->setOption(Image_3D::IMAGE_3D_OPTION_BF_CULLINGfalse);
  23. $world->setOption(Image_3D::IMAGE_3D_OPTION_FILLEDtrue);
  24.  
  25. $world->createRenderer('perspectively');
  26. $world->createDriver('ZBuffer');
  27. $world->render(400400'Image_3D_Pointlight.png');
  28.  
  29. 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.