Browse Source

新增一个合成纹理类文件,修改了printScene.php文件

master
yuanjiajia 3 years ago
parent
commit
a9e3eb7d59
  1. 4
      examples/PrintScene.php
  2. 95
      src/scene/texture/composite/Remap.php

4
examples/PrintScene.php

@ -13,13 +13,13 @@ $scene = new Scene();
$obj = new objects\Objects( [ 'ply' => 'mesh-10086.ply','appliedtransformation' => '1 0 0 0 0 1 0 0 0 0 1 0 0 0 0 1' ] ); //创建一个的模型 $obj = new objects\Objects( [ 'ply' => 'mesh-10086.ply','appliedtransformation' => '1 0 0 0 0 1 0 0 0 0 1 0 0 0 0 1' ] ); //创建一个的模型
$cloudsMap = new texture\procedural\Clouds(); //创建一个 Clouds类的贴图对象
$cloudsMap = new texture\procedural\BlenderClouds(); //创建一个 Clouds类的贴图对象
$scene->registerTexture($cloudsMap); //将这个对象注册到 Scene $scene->registerTexture($cloudsMap); //将这个对象注册到 Scene
$imageMap = new texture\procedural\ImageMap(); //创建一个 ImageMap类的贴图对象 $imageMap = new texture\procedural\ImageMap(); //创建一个 ImageMap类的贴图对象
$scene->registerTexture($imageMap); //将这个对象注册到 Scene $scene->registerTexture($imageMap); //将这个对象注册到 Scene
$blend = new texture\procedural\Blend(); //创建一个 Blend类的贴图对象
$blend = new texture\procedural\BlenderBlend(); //创建一个 Blend类的贴图对象
$scene->registerTexture($blend); //将这个对象注册到 Scene $scene->registerTexture($blend); //将这个对象注册到 Scene

95
src/scene/texture/composite/Remap.php

@ -0,0 +1,95 @@
<?php
namespace Blobt\Luxcore\scene\texture\composite;
use Blobt\Luxcore\scene\texture\TextureBase;
use Blobt\Luxcore\scene\Scene;
use Blobt\Luxcore\core\Base;
class Remap extends TextureBase
{
/**
* 贴图合成:重映射(将一张输入的纹理重新映射)
*/
const TYPE_REMAP = 'remap';
/**
* @var string 输入源(颜色通道),一个小数形式的RGB色值,或是一个textures(贴图数组)中的某个键名
*/
public $value = "0.5";
/**
* @var string 源最小色值,一个小数形式的RGB色值,或是一个textures(贴图数组)中的某个键名
*/
public $sourcemin = "0";
/**
* @var string 源最大色值,一个小数形式的RGB色值,或是一个textures(贴图数组)中的某个键名
*/
public $sourcemax = "1";
/**
* @var string 目标最小色值,一个小数形式的RGB色值,或是一个textures(贴图数组)中的某个键名
*/
public $targetmin = "0";
/**
* @var string 目标最大色值,一个小数形式的RGB色值,或是一个textures(贴图数组)中的某个键名
*/
public $targetmax = "1";
/**
* @param array $config 接收一个数组,可以初始化当前实例化对象的各种属性
*/
public function __construct($config = [])
{
$this->type = self::TYPE_REMAP;
$this->id = Scene::createID();
Base::__construct($config);
}
/**
* @param object $color 接收一个贴图对象或小数形式的色值,设置颜色通道(输入源)
*/
public function setTexture($color)
{
$this->value = Scene::testAbnormal($color);
}
/**
* @param object $color 接收一个贴图对象或小数形式的色值,设置源最小色值
*/
public function setSourcemin($color)
{
$this->sourcemin = Scene::testAbnormal($color);
}
/**
* @param object $color 接收一个贴图对象或小数形式的色值,设置源最大色值
*/
public function setSourcemax($color)
{
$this->sourcemax = Scene::testAbnormal($color);
}
/**
* @param object $color 接收一个贴图对象或小数形式的色值,设置目标最小色值
*/
public function setTargetmin($color)
{
$this->targetmin = Scene::testAbnormal($color);
}
/**
* @param object $color 接收一个贴图对象或小数形式的色值,设置目标最大色值
*/
public function setTargetmax($color)
{
$this->targetmax = Scene::testAbnormal($color);
}
}
?>
Loading…
Cancel
Save