Esempio n. 1
0
 public function __construct(Vector $pos, Vector $lookAt)
 {
     $this->pos = $pos;
     $down = new Vector(0.0, -1.0, 0.0);
     $this->forward = Vector::norm(Vector::minus($lookAt, $this->pos));
     $this->right = Vector::times(1.5, Vector::norm(Vector::cross($this->forward, $down)));
     $this->up = Vector::times(1.5, Vector::norm(Vector::cross($this->forward, $this->right)));
 }
Esempio n. 2
0
 public static function cross($a, $b)
 {
     $c = new Vector();
     return $c->cross($a, $b);
 }