Source for file ascii.php
Documentation is available at ascii.php
$images = 'php://output';
require_once('Image/3D.php');
$light1 = $world->createLight ('Light', array (-500 , -500 , -500 ));
$light2 = $world->createLight ('Light', array (0 , 500 , -550 ));
$p1 = $world->createObject ('cube', array (80 , 80 , 80 ));
$p1->transform ($world->createMatrix ('Rotation', array (45 , 45 , 0 )));
$world->setOption (Image_3D::IMAGE_3D_OPTION_BF_CULLING , false );
$world->setOption (Image_3D::IMAGE_3D_OPTION_FILLED , true );
$rotation = $world->createMatrix ('Rotation', array (2 , 5 , 0 ));
$renderer = $world->createRenderer ('perspectively');
$driver = $world->createDriver ('ASCII');
$world->render (2 * 80 , 6 * 30 , $images);
while ($i++ < $iterations) {
$p1->transform ($rotation);
$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.
|