Browse Source

渲染测式 开发

master
yuanjiajia 1 year ago
parent
commit
f9e1c2bf89
  1. 6
      examples/matRenderTest.php
  2. 6
      examples/renderTest.php

6
examples/matRenderTest.php

@ -121,6 +121,11 @@ $scene->registerObjects($obj);
// 二、添加要渲染的模型 // 二、添加要渲染的模型
foreach($taskModel->childsParams as $childParams){ foreach($taskModel->childsParams as $childParams){
// 如果某个模型节点不可见,则不添加到场景渲染
if($childParams->isVisible !== 1){
continue;
}
$cacheFileDir = $sceneTemplatePath.'/cacheFiles'; $cacheFileDir = $sceneTemplatePath.'/cacheFiles';
$material = null; $material = null;
$matOriginal = (function ($childParams){ $matOriginal = (function ($childParams){
@ -148,7 +153,6 @@ foreach($taskModel->childsParams as $childParams){
(new Client())->get($childParams->childPlyFile, [RequestOptions::SINK => $plyFileHandle]); (new Client())->get($childParams->childPlyFile, [RequestOptions::SINK => $plyFileHandle]);
$obj = new Objects(); $obj = new Objects();
$obj->ply = $plyFileSavaPath; $obj->ply = $plyFileSavaPath;
$obj->camerainvisible = $childParams->isVisible === 1 ? Objects::CLOSE : Objects::OPEN;
$obj->setMaterial($material); $obj->setMaterial($material);
$scene->registerObjects($obj); $scene->registerObjects($obj);
} }

6
examples/renderTest.php

@ -218,6 +218,11 @@ $scene->registerObjects($obj);
// 二、添加要渲染的模型 // 二、添加要渲染的模型
foreach($taskModel->childsParams as $childParams){ foreach($taskModel->childsParams as $childParams){
// 如果某个模型节点不可见,则不添加到场景渲染
if($childParams->isVisible !== 1){
continue;
}
$cacheFileDir = $sceneTemplatePath.'/cacheFiles'; $cacheFileDir = $sceneTemplatePath.'/cacheFiles';
$material = null; $material = null;
$matOriginal = (function ($childParams){ $matOriginal = (function ($childParams){
@ -245,7 +250,6 @@ foreach($taskModel->childsParams as $childParams){
(new Client())->get($childParams->childPlyFile, [RequestOptions::SINK => $plyFileHandle]); (new Client())->get($childParams->childPlyFile, [RequestOptions::SINK => $plyFileHandle]);
$obj = new Objects(); $obj = new Objects();
$obj->ply = $plyFileSavaPath; $obj->ply = $plyFileSavaPath;
$obj->camerainvisible = $childParams->isVisible === 1 ? Objects::CLOSE : Objects::OPEN;
$obj->setMaterial($material); $obj->setMaterial($material);
$scene->registerObjects($obj); $scene->registerObjects($obj);
} }

Loading…
Cancel
Save