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

Source for file Cone.php

Documentation is available at Cone.php

  1. <?php
  2.  
  3. require_once('Image/3D/Paintable/Object.php');
  4.  
  5.     
  6.     public function __construct($parameter{
  7.         parent::__construct();
  8.  
  9.         $radius = 1;
  10.         $height = 1;
  11.         $detail max(3(int) $parameter['detail']);
  12.  
  13.         // Generate points according to parameters
  14.         $top = new Image_3D_Point(0$height0);
  15.         $bottom = new Image_3D_Point(000);
  16.  
  17.         $last = new Image_3D_Point(100);
  18.         $points[$last;
  19.  
  20.         for ($i = 1; $i <= $detail; ++$i{
  21.             $actual = new Image_3D_Point(cos(deg2rad(360 * $i $detail))0sin(deg2rad(360 * $i $detail)));
  22.             $points[$actual;
  23.             
  24.             // Build polygon
  25.             $this->_addPolygon(new Image_3D_Polygon($top$last$actual));
  26.             $this->_addPolygon(new Image_3D_Polygon($bottom$last$actual));
  27.             $last $actual;
  28.         }
  29.  
  30.         // Build closing polygon
  31.         $this->_addPolygon(new Image_3D_Polygon($top$last$points[0]));
  32.         $this->_addPolygon(new Image_3D_Polygon($bottom$last$points[0]));
  33.     }
  34. }

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