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); }