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

Source for file torus.php

Documentation is available at torus.php

  1. <?php
  2.  
  3. require_once('Image/3D.php');
  4.  
  5. $world = new Image_3D();
  6. $world->setColor(new Image_3D_Color(255, 255, 255));
  7.  
  8. $light = $world->createLight('Light', array(-2000, -2000, -2000));
  9. $light->setColor(new Image_3D_Color(255, 255, 255));
  10.  
  11. $redLight = $world->createLight('Light', array(90, 0, 50));
  12. $redLight->setColor(new Image_3D_Color(255, 0, 0));
  13.  
  14. $torus = $world->createObject('torus', array('inner_radius' => 110, 'outer_radius' => 170, 'detail_1' => 60, 'detail_2' => 30));
  15. $torus->setColor(new Image_3D_Color(150, 150, 150));
  16. $torus->transform($world->createMatrix('Rotation', array(60, -10, 0)));
  17.  
  18. $renderer = $world->createRenderer('perspectively');
  19.  
  20. $world->createDriver('GD');
  21. $world->render(500, 500, 'Image_3D_Object_Torus.png');
  22.  
  23. echo $world->stats();

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