<?php /* ************************************************************************** */ /* */ /* main_02.php for J06 */ /* Created on : Mon Mar 31 17:37:41 2014 */ /* Made by : David "Thor" GIRON <*****@*****.**> */ /* */ /* ************************************************************************** */ require_once 'Vertex.class.php'; require_once 'Vector.class.php'; Vertex::$verbose = False; print Vector::doc(); Vector::$verbose = True; $vtxO = new Vertex(array('x' => 0.0, 'y' => 0.0, 'z' => 0.0)); $vtxX = new Vertex(array('x' => 1.0, 'y' => 0.0, 'z' => 0.0)); $vtxY = new Vertex(array('x' => 0.0, 'y' => 1.0, 'z' => 0.0)); $vtxZ = new Vertex(array('x' => 0.0, 'y' => 0.0, 'z' => 1.0)); $vtcXunit = new Vector(array('orig' => $vtxO, 'dest' => $vtxX)); $vtcYunit = new Vector(array('orig' => $vtxO, 'dest' => $vtxY)); $vtcZunit = new Vector(array('orig' => $vtxO, 'dest' => $vtxZ)); print $vtcXunit . PHP_EOL; print $vtcYunit . PHP_EOL; print $vtcZunit . PHP_EOL; $dest1 = new Vertex(array('x' => -12.34, 'y' => 23.45, 'z' => -34.56)); Vertex::$verbose = True; $vtc1 = new Vector(array('dest' => $dest1)); Vertex::$verbose = False; $orig2 = new Vertex(array('x' => 23.87, 'y' => -37.95, 'z' => 78.34)); $dest2 = new Vertex(array('x' => -12.34, 'y' => 23.45, 'z' => -34.56)); $vtc2 = new Vector(array('orig' => $orig2, 'dest' => $dest2));
<?php /* ************************************************************************** */ /* */ /* main_04.php for J06 */ /* Created on : Mon Mar 31 17:37:41 2014 */ /* Made by : David "Thor" GIRON <*****@*****.**> */ /* */ /* ************************************************************************** */ require_once 'Vertex.class.php'; require_once 'Vector.class.php'; require_once 'Matrix.class.php'; require_once 'Camera.class.php'; Vertex::$verbose = False; Vector::$verbose = False; Matrix::$verbose = False; print Camera::doc(); Camera::$verbose = True; $vtxO = new Vertex(array('x' => 20.0, 'y' => 20.0, 'z' => 80.0)); $R = new Matrix(array('preset' => Matrix::RY, 'angle' => M_PI)); $cam = new Camera(array('origin' => $vtxO, 'orientation' => $R, 'width' => 640, 'height' => 480, 'fov' => 60, 'near' => 1.0, 'far' => 100.0)); print $cam . PHP_EOL;