Source for file ascii_demo.php
Documentation is available at ascii_demo.php
$images = 'php://output';
require_once('Image/3D.php');
$light1 = $world->createLight ('Light', array (-500 , 0 , -500 ));
$light2 = $world->createLight ('Light', array (500 , 0 , -500 ));
$p1 = $world->createObject ('torus', array ('inner_radius' => 50 , 'outer_radius' => 90 , 'detail_1' => 10 , 'detail_2' => 1 ));
$world->setOption (Image_3D::IMAGE_3D_OPTION_BF_CULLING , false );
$world->setOption (Image_3D::IMAGE_3D_OPTION_FILLED , true );
$rotation = $world->createMatrix ('Rotation', array (0 , 0 , 15 ));
$Xrotation = $world->createMatrix ('Rotation', array (10 , 2 , 0 ));
$move = $world->createMatrix ('Move', array (0 , 0 , -10 ));
$renderer = $world->createRenderer ('perspectively');
$driver = $world->createDriver ('ASCII');
$world->render (2 * 100 , 6 * 50 , $images);
while ($i++ < $iterations) {
$light1->transform ($rotation);
$light2->transform ($rotation);
$p1->transform ($Xrotation);
$renderer->render ($images);
printf("%2.2f fps\n", $iterations / $time);
Documentation generated on Mon, 11 Mar 2019 15:48:13 -0400 by phpDocumentor 1.4.4. PEAR Logo Copyright © PHP Group 2004.
|