shulrak

Untitled

Mar 26th, 2016
174
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 1.98 KB | None | 0 0
  1. <?php
  2. /* ************************************************************************** */
  3. /*                                                                            */
  4. /*                 main_01.php for J06                                        */
  5. /*                 Created on : Mon Mar 31 17:37:41 2014                      */
  6. /*                 Made by : David "Thor" GIRON <thor@42.fr>                  */
  7. /*                                                                            */
  8. /* ************************************************************************** */
  9. require_once 'Color.class.php';
  10. require_once 'Vertex.class.php';
  11. Color::$verbose = False;
  12. print( Vertex::doc() );
  13. Vertex::$verbose = True;
  14. $vtxO  = new Vertex( array( 'x' => 0.0, 'y' => 0.0, 'z' => 0.0 ) );
  15. print( $vtxO  . PHP_EOL );
  16. $red   = new Color( array( 'red' => 255, 'green' =>   0, 'blue' =>   0 ) );
  17. $green = new Color( array( 'red' =>   0, 'green' => 255, 'blue' =>   0 ) );
  18. $blue  = new Color( array( 'red' =>   0, 'green' =>   0, 'blue' => 255 ) );
  19. $unitX = new Vertex( array( 'x' => 1.0, 'y' => 0.0, 'z' => 0.0, 'color' => $green ) );
  20. $unitY = new Vertex( array( 'x' => 0.0, 'y' => 1.0, 'z' => 0.0, 'color' => $red   ) );
  21. $unitZ = new Vertex( array( 'x' => 0.0, 'y' => 0.0, 'z' => 1.0, 'color' => $blue  ) );
  22. print( $unitX . PHP_EOL );
  23. print( $unitY . PHP_EOL );
  24. print( $unitZ . PHP_EOL );
  25. Vertex::$verbose = False;
  26. $sqrA = new Vertex( array( 'x' => 0.0, 'y' => 0.0, 'z' => 0.0 ) );
  27. $sqrB = new Vertex( array( 'x' => 4.2, 'y' => 0.0, 'z' => 0.0 ) );
  28. $sqrC = new Vertex( array( 'x' => 4.2, 'y' => 4.2, 'z' => 0.0 ) );
  29. $sqrD = new Vertex( array( 'x' => 0.0, 'y' => 4.2, 'z' => 0.0 ) );
  30. print( $sqrA . PHP_EOL );
  31. print( $sqrB . PHP_EOL );
  32. print( $sqrC . PHP_EOL );
  33. print( $sqrD . PHP_EOL );
  34. $A = new Vertex( array( 'x' => 3.0, 'y' => 3.0, 'z' => 3.0 ) );
  35. print( $A . PHP_EOL );
  36. $equA = new Vertex( array( 'x' => 9.0, 'y' => 9.0, 'z' => 9.0, 'w' => 3.0 ) );
  37. print( $equA . PHP_EOL );
  38. Vertex::$verbose = True;
  39. ?>
Add Comment
Please, Sign In to add comment