Esempio n. 1
0
 /**
  * Caclulate Screen Coordinates
  *
  * Calculate perspectively screen coordinates for a point
  *
  * @param Image_3D_Point $point Point to process
  *
  * @return  void
  */
 protected function _calculateScreenCoordiantes(Image_3D_Point $point)
 {
     $viewpoint = 500.0;
     $distance = 500.0;
     $point->setScreenCoordinates($viewpoint * $point->getX() / ($point->getZ() + $distance) + $this->_size[0], $viewpoint * $point->getY() / ($point->getZ() + $distance) + $this->_size[1]);
 }
Esempio n. 2
0
 /**
  * Caclulate Screen Coordinates
  *
  * Calculate isometric screen coordinates for a point 
  *
  * @param Image_3D_Point $point Point to process
  *
  * @return  void
  */
 protected function _calculateScreenCoordiantes(Image_3D_Point $point)
 {
     $point->setScreenCoordinates($point->getX() - $point->getZ() * 0.35 + $this->_size[0], $point->getY() + $point->getZ() * 0.35 + $this->_size[1]);
 }
Esempio n. 3
0
 public function addPoint(Image_3D_Point $point)
 {
     $this->_points[] = $point;
     // Adjust bounding rectangle
     if (!isset($this->_boundingRect[0]) || $point->getX() < $this->_boundingRect[0]) {
         $this->_boundingRect[0] = $point->getX();
     }
     if (!isset($this->_boundingRect[1]) || $point->getY() < $this->_boundingRect[1]) {
         $this->_boundingRect[1] = $point->getY();
     }
     if (!isset($this->_boundingRect[2]) || $point->getZ() < $this->_boundingRect[2]) {
         $this->_boundingRect[2] = $point->getZ();
     }
     if (!isset($this->_boundingRect[3]) || $point->getX() > $this->_boundingRect[3]) {
         $this->_boundingRect[3] = $point->getX();
     }
     if (!isset($this->_boundingRect[4]) || $point->getY() > $this->_boundingRect[4]) {
         $this->_boundingRect[4] = $point->getY();
     }
     if (!isset($this->_boundingRect[5]) || $point->getZ() > $this->_boundingRect[5]) {
         $this->_boundingRect[5] = $point->getZ();
     }
 }