Source for file 3ds.php
Documentation is available at 3ds.php
require_once('Image/3D.php');
// Erstellung einer globalen Lichtquelle
$light = $world->createLight ('Light', array (-2000 , -2000 , -2000 ));
// Eines Punktuellen Lichtes mit distancefalloff
$light = $world->createLight ('Point', array (0 , -100 , 0 , 'distance' => 200 , 'falloff' => 2 ));
$light = $world->createLight ('Spotlight', array (500 , -500 , -300 , 'aim' => array (50 , 30 , 0 ), 'angle' => 10 , 'float' => 2 ));
$sphere = $world->createObject ('sphere', array ('r' => 120 , 'detail' => 5 ));
$sphere->transform ($world->createMatrix ('Move', array (70 , 40 , 0 )));
// Import eines 3ds-Objekts (Schriftzug "Image 3D")
$text = $world->createObject ('3ds', 'docs/examples/models/Image_3D.3ds');
$text->transform ($world->createMatrix ('Rotation', array (90 , 0 , 0 )));
$text->transform ($world->createMatrix ('Scale', array (5 , 5 , 5 )));
$text->transform ($world->createMatrix ('Move', array (0 , -40 , 0 )));
// Transformationen auf alle Objecte anwenden
$text->transform ($world->createMatrix ('Scale', array (2 , 2 , 2 )));
// Erzeugen des gewuenschten Renderers
$world->createRenderer ('perspectively');
// Erzeugen des gewuenschten Ausgabetreibers
$world->createDriver ('SVG');
$world->render (800 , 400 , 'example.svg');
// Ausgabe einiger Statistiken zu dem gerade erstellten Bild
Documentation generated on Mon, 11 Mar 2019 15:48:13 -0400 by phpDocumentor 1.4.4. PEAR Logo Copyright © PHP Group 2004.
|