From f9e1c2bf89d767558e92d616539504deb8ce80fe Mon Sep 17 00:00:00 2001 From: yuanjiajia <1139393632@qq.com> Date: Tue, 11 Jul 2023 10:13:38 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B8=B2=E6=9F=93=E6=B5=8B=E5=BC=8F=20?= =?UTF-8?q?=E5=BC=80=E5=8F=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- examples/matRenderTest.php | 6 +++++- examples/renderTest.php | 6 +++++- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/examples/matRenderTest.php b/examples/matRenderTest.php index 945ce63..2591020 100644 --- a/examples/matRenderTest.php +++ b/examples/matRenderTest.php @@ -121,6 +121,11 @@ $scene->registerObjects($obj); // 二、添加要渲染的模型 foreach($taskModel->childsParams as $childParams){ + // 如果某个模型节点不可见,则不添加到场景渲染 + if($childParams->isVisible !== 1){ + continue; + } + $cacheFileDir = $sceneTemplatePath.'/cacheFiles'; $material = null; $matOriginal = (function ($childParams){ @@ -148,7 +153,6 @@ foreach($taskModel->childsParams as $childParams){ (new Client())->get($childParams->childPlyFile, [RequestOptions::SINK => $plyFileHandle]); $obj = new Objects(); $obj->ply = $plyFileSavaPath; - $obj->camerainvisible = $childParams->isVisible === 1 ? Objects::CLOSE : Objects::OPEN; $obj->setMaterial($material); $scene->registerObjects($obj); } diff --git a/examples/renderTest.php b/examples/renderTest.php index aef3d51..6c385eb 100644 --- a/examples/renderTest.php +++ b/examples/renderTest.php @@ -218,6 +218,11 @@ $scene->registerObjects($obj); // 二、添加要渲染的模型 foreach($taskModel->childsParams as $childParams){ + // 如果某个模型节点不可见,则不添加到场景渲染 + if($childParams->isVisible !== 1){ + continue; + } + $cacheFileDir = $sceneTemplatePath.'/cacheFiles'; $material = null; $matOriginal = (function ($childParams){ @@ -245,7 +250,6 @@ foreach($taskModel->childsParams as $childParams){ (new Client())->get($childParams->childPlyFile, [RequestOptions::SINK => $plyFileHandle]); $obj = new Objects(); $obj->ply = $plyFileSavaPath; - $obj->camerainvisible = $childParams->isVisible === 1 ? Objects::CLOSE : Objects::OPEN; $obj->setMaterial($material); $scene->registerObjects($obj); }