Browse Source

渲染测式 案例 开发

master
yuanjiajia 1 year ago
parent
commit
3a191dbd3c
  1. 25
      README.md
  2. 11
      examples/renderTest.php

25
README.md

@ -1,2 +1,27 @@
# luxcore # luxcore
## 安装 Imagick 扩展
进入 download 目录执行: `wget http://www.imagemagick.org/download/ImageMagick.tar.gz`
解压: `tar -xzvf ImageMagick.tar.gz`
进入解压目录: `cd ImageMagick-*`
切换到ROOT用户后,执行: `./configure -prefix=/usr/local/imagemagick -enable-lzw -with-modules && make && make install`
安装成功检: `/usr/local/imagemagick/bin/convert -version`
将conver命令加入PATH中: `gedit /etc/environment`
在PATH中加入: `/usr/local/imagemagick/bin`
使PATH配置生效: `source /etc/environment`
退出ROOT用户:`exit`
进入 download 目录执行: `wget http://pecl.php.net/get/imagick-3.7.0.tgz`
解压: `tar -xzvf imagick-3.7.0.tgz`
进入解压目录: `cd imagick-3.7.0`
切换到ROOT用户后,用 phpize 命令 挂载当前目录: `phpize`
配置编译: `./configure --with-php-config={替换为自已php安装目录下的 ’php-config‘ 路径} --with-imagick=/usr/local/imagemagick`
编译安装: `make && make install`
编译成功后会在php 扩展目录生成imagick.so,在 php.ini 里面加上: `extension="imagick.so"`
检查 Imagick 扩展是否安装成功: `php -m | grep imagick`
## 初始化
### composer
在项目目录下执行 `composer install`

11
examples/renderTest.php

@ -49,6 +49,7 @@ $result = json_decode($resContents,false);
$taskData = $result->data; $taskData = $result->data;
$taskScene = $taskData->scene; $taskScene = $taskData->scene;
$taskModel = $taskScene->model; $taskModel = $taskScene->model;
$taskCamera = $taskScene->camera;
@ -248,13 +249,13 @@ foreach($taskModel->childsParams as $childParams){
$camera = new camera\Perspective( $camera = new camera\Perspective(
[ [
'autovolumeEnable' => 0, 'autovolumeEnable' => 0,
'lookatOrig' => "-3.197486 -4.560584 0.8914337",
'lookatTarget' => "-2.632151 -3.747173 0.7544713",
'up' => "0.0781663 0.1124666 0.9905763",
'lookatOrig' => "{$taskCamera->position->x} {$taskCamera->position->y} {$taskCamera->position->z}",
'lookatTarget' => "{$taskCamera->target->x} {$taskCamera->target->y} {$taskCamera->target->z}",
'up' => "{$taskCamera->rotation->x} {$taskCamera->rotation->y} {$taskCamera->rotation->z}",
'screenwindow' => "-1 1 -1 1", 'screenwindow' => "-1 1 -1 1",
'autofocusEnable' => 0, 'autofocusEnable' => 0,
'fieldofview' => 3.40608,
'cliphither' => 0.1
'fieldofview' => $taskCamera->fov,
'cliphither' => 0.1,
] ]
); );
$camera->bokeh->blades = 0; $camera->bokeh->blades = 0;

Loading…
Cancel
Save