From 26646cf248156f8896ffc1acc4d32225202e064d Mon Sep 17 00:00:00 2001 From: yuanjiajia <1139393632@qq.com> Date: Fri, 25 Feb 2022 19:39:21 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E4=BA=86=E2=80=9Cprint.php?= =?UTF-8?q?=E2=80=9D=E3=80=81=E2=80=9CDisney.php=E2=80=9D=E4=B8=A4?= =?UTF-8?q?=E4=B8=AA=E7=B1=BB=E6=96=87=E4=BB=B6=EF=BC=8C=E6=96=B0=E5=A2=9E?= =?UTF-8?q?=E4=BA=86=E2=80=9CGlass.php=E2=80=9D=E3=80=81=E2=80=9CGlossy.ph?= =?UTF-8?q?p=E2=80=9D=E3=80=81=E2=80=9CMetal.php=E2=80=9D=E3=80=81?= =?UTF-8?q?=E2=80=9CNullMaterial.php=E2=80=9D=E3=80=81=E2=80=9CRoughmatte.?= =?UTF-8?q?php=E2=80=9D=E4=BA=94=E4=B8=AA=E6=9D=90=E8=B4=A8=E7=9B=B8?= =?UTF-8?q?=E5=85=B3=E7=9A=84=E7=B1=BB=E6=96=87=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- examples/print.php | 3 +- src/scene/materials/Disney.php | 2 +- src/scene/materials/Glass.php | 89 ++++++++++++++++++++++++++++ src/scene/materials/Glossy.php | 75 +++++++++++++++++++++++ src/scene/materials/Metal.php | 50 ++++++++++++++++ src/scene/materials/NullMaterial.php | 34 +++++++++++ src/scene/materials/Roughmatte.php | 44 ++++++++++++++ 7 files changed, 295 insertions(+), 2 deletions(-) create mode 100644 src/scene/materials/Glass.php create mode 100644 src/scene/materials/Glossy.php create mode 100644 src/scene/materials/Metal.php create mode 100644 src/scene/materials/NullMaterial.php create mode 100644 src/scene/materials/Roughmatte.php diff --git a/examples/print.php b/examples/print.php index f1ba359..b83710c 100644 --- a/examples/print.php +++ b/examples/print.php @@ -76,7 +76,8 @@ $scene->objects[0]->appliedtransformation = '1 0 0 0 0 1 0 0 0 0 1 0 0 0 0 1'; -$scene->materials[8] = new materials\Disney(); //在场景中创建一个编号为8的 Disney材质, +$scene->materials[8] = new materials\Metal(); //在场景中创建一个编号为8的 Metal材质, +$scene->materials[8]->fresnel = "2517393611944Fresnel"; //指定金属材质菲列尔参数为一个颜色类型的贴图 $scene->objects[1] = new Objects(); //在场景中创建一个编号为1的模型, $scene->objects[1]->material = 8; //为模型指定编号为8的材质 diff --git a/src/scene/materials/Disney.php b/src/scene/materials/Disney.php index 82ff442..5ea1e73 100644 --- a/src/scene/materials/Disney.php +++ b/src/scene/materials/Disney.php @@ -37,7 +37,7 @@ class Disney extends MaterialsBase public $roughness = 0.2; /** - * @var float 各向异性反身,一个0-1的小数,或是一个textures(贴图数组)中的某个键名 + * @var float 各向异性反射,一个0-1的小数,或是一个textures(贴图数组)中的某个键名 */ public $anisotropic = 0; diff --git a/src/scene/materials/Glass.php b/src/scene/materials/Glass.php new file mode 100644 index 0000000..f14da6c --- /dev/null +++ b/src/scene/materials/Glass.php @@ -0,0 +1,89 @@ +type = self::TYPE_GLASS; + $this->emissionCfg = new Emission($config); + $this->visibility = new Visibility($config); + Base::__construct($config); + } + +} + +?> diff --git a/src/scene/materials/Glossy.php b/src/scene/materials/Glossy.php new file mode 100644 index 0000000..c738dc2 --- /dev/null +++ b/src/scene/materials/Glossy.php @@ -0,0 +1,75 @@ +type = 'glossy2'; + $this->emissionCfg = new Emission($config); + $this->visibility = new Visibility($config); + Base::__construct($config); + } + +} + +?> diff --git a/src/scene/materials/Metal.php b/src/scene/materials/Metal.php new file mode 100644 index 0000000..5df183a --- /dev/null +++ b/src/scene/materials/Metal.php @@ -0,0 +1,50 @@ +type = 'metal2'; + $this->emissionCfg = new Emission($config); + $this->visibility = new Visibility($config); + Base::__construct($config); + } + +} + +?> diff --git a/src/scene/materials/NullMaterial.php b/src/scene/materials/NullMaterial.php new file mode 100644 index 0000000..028ab0f --- /dev/null +++ b/src/scene/materials/NullMaterial.php @@ -0,0 +1,34 @@ +type = 'null'; + $this->emissionCfg = new Emission($config); + $this->visibility = new Visibility($config); + Base::__construct($config); + } + +} + +?> diff --git a/src/scene/materials/Roughmatte.php b/src/scene/materials/Roughmatte.php new file mode 100644 index 0000000..0ff327f --- /dev/null +++ b/src/scene/materials/Roughmatte.php @@ -0,0 +1,44 @@ +type = 'roughmatte'; + $this->emissionCfg = new Emission($config); + $this->visibility = new Visibility($config); + Base::__construct($config); + } + +} + +?>