diff --git a/examples/print.php b/examples/print.php index 1d49bc9..625aeb7 100644 --- a/examples/print.php +++ b/examples/print.php @@ -4,6 +4,7 @@ namespace Blobt\Luxcore\scene; + include dirname(dirname(__FILE__)) . "/vendor/autoload.php"; @@ -76,7 +77,7 @@ echo "\n\n\n\n"; $scene = new Scene();//创建一个场景, - +/* //添加第一个模型 $obj = new objects\Objects( [ 'ply' => 'mesh-10086.ply','appliedtransformation' => '1 0 0 0 0 1 0 0 0 0 1 0 0 0 0 1' ] ); //创建一个的模型 @@ -100,7 +101,6 @@ $scene->registerMaterial($disney); //将这个对象注册到 Scene $metal = new materials\Metal(); //创建一个 Disney 材质对象 -$metal->setRefraction($imageMap); $metal->setBumptex($cloudsMap); $scene->registerMaterial($metal); //将这个对象注册到 Scene @@ -115,13 +115,21 @@ $scene->registerMaterial($mix); //将这个对象注册到 Scene $obj->setMaterial($mix) ; //为模型的指定一个混合材质 $scene->registerObjects($obj); //将模型添加到场景中 +*/ + + +//添加第二个模型 +$obj = new objects\Objects( [ 'ply' => 'mesh-119.ply','appliedtransformation' => '1 0 0 0 0 1 0 0 0 0 1 0 0 0 0 1' ] ); //创建一个的模型, +$ClearVol = new volumes\Clear(); //创建一个 Clear体积材质 +$scene->registerVolume($ClearVol); //将体积材质注册到Scene +$colorGlass = new materials\Glass(); //创建一个玻璃材质, +$colorGlass->setVolumeInterior($ClearVol); //将 Clear体积材质赋值到玻璃材质 的 体积属性 +$scene->registerMaterial($colorGlass); //将玻璃材质注册到 Scene -// //添加第二个模型 -// $obj = new objects\Objects( [ 'ply' => 'mesh-119.ply','appliedtransformation' => '1 0 0 0 0 1 0 0 0 0 1 0 0 0 0 1' ] ); //创建一个的模型, -// $obj->material = new materials\Metal( ['fresnel' => "2517393611944Fresnel"] ); //为模型创建一个 金属 类型的材质 -// $scene->addObject($obj); //将模型添加到场景中 +$obj->setMaterial($colorGlass); //将玻璃材质赋值到模型的材质属性 +$scene->registerObjects($obj); //将模型添加到场景中 diff --git a/src/scene/volumes/Clear.php b/src/scene/volumes/Clear.php new file mode 100644 index 0000000..87766ab --- /dev/null +++ b/src/scene/volumes/Clear.php @@ -0,0 +1,10 @@ + diff --git a/src/scene/volumes/VolumesBase.php b/src/scene/volumes/VolumesBase.php index 8513789..d80e489 100644 --- a/src/scene/volumes/VolumesBase.php +++ b/src/scene/volumes/VolumesBase.php @@ -2,18 +2,23 @@ namespace Blobt\Luxcore\scene\volumes; use Blobt\Luxcore\scene\BaseCfg; -use Blobt\Luxcore\scene\Scene; -use Blobt\Luxcore\core\Base; class VolumesBase extends BaseCfg { + /** + * @var string 贴图类型 + */ + public $type; - public function __construct($config = []) - { - $this->id = Scene::createID(); - Base::__construct($config); - } + /** + * @var integer 当前贴图的ID号(取值:大于0的整数) + */ + public $id; + /** + * @var string TODO:储存个由Scene类颁发的注册信息,后期会屏敝此参数的输出 + */ + public $cards; } ?>