From 85469165156fb64408791392be652bb92c4f2056 Mon Sep 17 00:00:00 2001 From: yuanjiajia <1139393632@qq.com> Date: Sun, 13 Mar 2022 12:19:56 +0800 Subject: [PATCH] =?UTF-8?q?=E6=96=B0=E5=A2=9E=E4=B8=89=E4=B8=AA=E7=A8=8B?= =?UTF-8?q?=E5=BA=8F=E7=BA=B9=E7=90=86=E7=B1=BB=E6=96=87=E4=BB=B6=E4=B8=AD?= =?UTF-8?q?=EF=BC=8CScene=E7=B1=BB=E6=96=87=E4=BB=B6=E4=BF=AE=E6=AD=A3test?= =?UTF-8?q?Abnormal=E5=87=BD=E6=95=B0=E8=BF=94=E5=9B=9E=E5=80=BC=E9=94=99?= =?UTF-8?q?=E8=AF=AF=E7=9A=84=E9=97=AE=E9=A2=98=EF=BC=8CFbm.php=E6=96=87?= =?UTF-8?q?=E4=BB=B6=E4=BF=AE=E4=BA=86=E9=83=A8=E5=88=86=E6=B3=A8=E9=87=8A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/scene/Scene.php | 2 +- .../texture/procedural/Checkerboard2d.php | 63 +++++++++++++++++++ .../texture/procedural/Checkerboard3d.php | 63 +++++++++++++++++++ src/scene/texture/procedural/Fbm.php | 2 +- src/scene/texture/procedural/Marble.php | 53 ++++++++++++++++ 5 files changed, 181 insertions(+), 2 deletions(-) create mode 100644 src/scene/texture/procedural/Checkerboard2d.php create mode 100644 src/scene/texture/procedural/Checkerboard3d.php create mode 100644 src/scene/texture/procedural/Marble.php diff --git a/src/scene/Scene.php b/src/scene/Scene.php index 0210c50..d800b22 100644 --- a/src/scene/Scene.php +++ b/src/scene/Scene.php @@ -57,7 +57,7 @@ class Scene extends BaseCfg { if( $value->registerId != null ) { - return $value; + return $value->registerId; } else { diff --git a/src/scene/texture/procedural/Checkerboard2d.php b/src/scene/texture/procedural/Checkerboard2d.php new file mode 100644 index 0000000..983a531 --- /dev/null +++ b/src/scene/texture/procedural/Checkerboard2d.php @@ -0,0 +1,63 @@ +mapping = $mapping; + else $this->mapping = new Mapping(); + $this->type = self::TYPE_CHECKERBOARD2D; + $this->id = Scene::createID(); + Base::__construct($config); + } + + /** + * @param object $color 接收一个贴图对象或小数形式的色值,设置棋盘格子颜色1 + */ + public function setTexture1($color) + { + $this->texture1 = Scene::testAbnormal($color); + } + + /** + * @param object $color 接收一个贴图对象或小数形式的色值,设置棋盘格子颜色2 + */ + public function setTexture2($color) + { + $this->texture2 = Scene::testAbnormal($color); + } + +} + +?> diff --git a/src/scene/texture/procedural/Checkerboard3d.php b/src/scene/texture/procedural/Checkerboard3d.php new file mode 100644 index 0000000..a3e4133 --- /dev/null +++ b/src/scene/texture/procedural/Checkerboard3d.php @@ -0,0 +1,63 @@ +mapping = $mapping; + else $this->mapping = new Mapping(); + $this->type = self::TYPE_CHECKERBOARD3D; + $this->id = Scene::createID(); + Base::__construct($config); + } + + /** + * @param object $color 接收一个贴图对象或小数形式的色值,设置棋盘格子颜色1 + */ + public function setTexture1($color) + { + $this->texture1 = Scene::testAbnormal($color); + } + + /** + * @param object $color 接收一个贴图对象或小数形式的色值,设置棋盘格子颜色2 + */ + public function setTexture2($color) + { + $this->texture2 = Scene::testAbnormal($color); + } + +} + +?> diff --git a/src/scene/texture/procedural/Fbm.php b/src/scene/texture/procedural/Fbm.php index e7bb950..0ee865a 100644 --- a/src/scene/texture/procedural/Fbm.php +++ b/src/scene/texture/procedural/Fbm.php @@ -21,7 +21,7 @@ class Fbm extends TextureBase public $octaves = "8"; /** - * @var string 粗糙度,控制每个色块边缘向黑色过的平滑度,值越小,越平滑,同时 octaves参数对结果的影响力越小,反之亦然,(0-1的小数) + * @var string 粗糙度,控制每个色块边缘向黑色过渡的平滑度,值越小,越平滑,同时 octaves参数对结果的影响力越小,反之亦然,(0-1的小数) */ public $roughness = 0.5; diff --git a/src/scene/texture/procedural/Marble.php b/src/scene/texture/procedural/Marble.php new file mode 100644 index 0000000..018cd3a --- /dev/null +++ b/src/scene/texture/procedural/Marble.php @@ -0,0 +1,53 @@ +mapping = $mapping; + else $this->mapping = new Mapping(); + $this->type = self::TYPE_MARBLE; + $this->id = Scene::createID(); + Base::__construct($config); + } + +} + +?>