Rendering学習日記

日々3DCGの世界は進歩しているけど、勉強して理解したことをまとめていきたい。RenderMan互換レンダラーやグローバル・イルミネーション。いろんなことに好奇心を持ち面白くなってくる。目指せShader書き!!

64bit Windows10 install

とりいそぎ、メモ:
ありがとうございます。

Microsoft Windows [Version 10.0.10240]
(c) 2015 Microsoft Corporation. All rights reserved.

C:\Users\Downloads>python
Python 2.7.12 (v2.7.12:d33e0cf91556, Jun 27 2016, 15:24:40) [MSC v.1500 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> ^Z


C:\Users\Downloads>pip install Pillow-3.4.2-cp27-cp27m-win_amd64.whl
Processing c:\users\sensei\downloads\pillow-3.4.2-cp27-cp27m-win_amd64.whl
Installing collected packages: Pillow
Successfully installed Pillow-3.4.2
You are using pip version 8.1.1, however version 9.0.1 is available.
You should consider upgrading via the 'python -m pip install --upgrade pip' command.

C:\Users\Downloads>python -m pip install --upgrade pip
Collecting pip
Using cached pip-9.0.1-py2.py3-none-any.whl
Installing collected packages: pip
Found existing installation: pip 8.1.1
Uninstalling pip-8.1.1:
Successfully uninstalled pip-8.1.1
Successfully installed pip-9.0.1

C:\Users\Downloads>pip freeze
Pillow==3.4.2

C:\Users\Downloads>pip install pygame-1.9.2b1-cp27-cp27m-win_amd64.whl
Processing c:\users\sensei\downloads\pygame-1.9.2b1-cp27-cp27m-win_amd64.whl
Installing collected packages: pygame
Successfully installed pygame-1.9.2b1

C:\Users\sensei\Downloads>pip freeze
Pillow==3.4.2
pygame==1.9.2b1

C:\Users\Downloads>pip install PyOpenGL-3.1.1-cp27-cp27m-win_amd64.whl
Processing c:\users\sensei\downloads\pyopengl-3.1.1-cp27-cp27m-win_amd64.whl
Installing collected packages: PyOpenGL
Successfully installed PyOpenGL-3.1.1

C:\Users\Downloads>pip install ode-0.13.1-cp27-cp27m-win_amd64.whl
Processing c:\users\sensei\downloads\ode-0.13.1-cp27-cp27m-win_amd64.whl
Installing collected packages: ode
Successfully installed ode-0.13.1

C:\Users\Downloads>pip install cgkit-2.0.0-cp27-none-win_amd64.whl
Processing c:\users\sensei\downloads\cgkit-2.0.0-cp27-none-win_amd64.whl
Installing collected packages: cgkit
Successfully installed cgkit-2.0.0

C:\Users\Downloads>python -m pip install --upgrade pip


Microsoft Windows [Version 10.0.10240]
(c) 2015 Microsoft Corporation. All rights reserved.

>viewer.py demo1.py

>viewer.py demo3.py

>render.py -rprman demo1.py
Exporting main.rib...
1 passes...
Compiling shaders...
gldistantlight: compiled.
glmaterial: compiled.
glpointlight: compiled.
glspotlight: compiled.
spotlight3ds: compiled.
Preprocessing time: 0s
Rendering "out.tif" (frame 0)...
Rendering time: 0s

>sho out.tif
cgkit | - | -

Python27とcgkit install (Windows7 32bit)

Python2.7.10をインストールするとpipもインストールされました。とても便利になりました。
pythonのモジュールはwhlが多くなってきました。

>pip install hoge****.whl

のような感じで簡単にインストールできます。

■Python2.7.10をインストールした後、
Windowsの環境変数Pathに以下を追記します。
気をつけて行います。既存のパスの最後に付けます

;C:\Python27;C:\Python27\Scripts

■ここで再起動します。

■次に、以下からダウンロードします。

http://www.lfd.uci.edu/~gohlke/pythonlibs/

Pillow-2.8.2-cp27-none-win32.whl
pygame-1.9.2a0-cp27-none-win32.whl
ode-0.13.1-cp27-none-win32.whl
PyOpenGL-3.1.1a1-cp27-none-win32.whl
cgkit-2.0.0-cp27-none-win32.whl

をダウンロードします。
またVpythonを使いたいならば
VPython-5.74-cp27-none-win32.whl

Microsoftから
VCForPython27.msiをダウンロードして
インストールします。

以下は、試したログです。
Microsoft Windows [Version 6.1.7600]
Copyright (c) 2009 Microsoft Corporation. All rights reserved.

D:\Aplication>pip install Pillow-2.8.2-cp27-none-win32.whl
Processing d:\aplication\pillow-2.8.2-cp27-none-win32.whl
Installing collected packages: Pillow
Successfully installed Pillow-2.8.2

D:\Aplication>pip freeze
Pillow==2.8.2
pyglet==1.2.2
pyprocessing==0.1.3.22

D:\Aplication>pip install pygame-1.9.2a0-cp27-none-win32.whl
Processing d:\aplication\pygame-1.9.2a0-cp27-none-win32.whl
Installing collected packages: pygame
Successfully installed pygame-1.9.2a0

D:\Aplication>pip install ode-0.13.1-cp27-none-win32.whl
Processing d:\aplication\ode-0.13.1-cp27-none-win32.whl
Installing collected packages: ode
Successfully installed ode-0.13.1

D:\Aplication>pip install cgkit-2.0.0-cp27-none-win32.whl
Processing d:\aplication\cgkit-2.0.0-cp27-none-win32.whl
Installing collected packages: cgkit
Successfully installed cgkit-2.0.0

D:\Aplication>pip install PyOpenGL-3.1.1a1-cp27-none-win32.whl
Processing d:\aplication\pyopengl-3.1.1a1-cp27-none-win32.whl
Installing collected packages: PyOpenGL
Successfully installed PyOpenGL-3.1.1a1
■ここは時間かかります。しばらく待ちます。


■ここからVpythonのインストールです。
最初、エラーでインストールできませんでした。

D:\Aplication>pip install VPython-5.74-cp27-none-win32.whl
Processing d:\aplication\vpython-5.74-cp27-none-win32.whl
Collecting fonttools (from VPython==5.74)
Downloading FontTools-2.4.tar.gz (323kB)
100% |################################| 327kB 369kB/s
Collecting TTFQuery (from VPython==5.74)
Downloading TTFQuery-1.0.5.tar.gz
Collecting Polygon2 (from VPython==5.74)
Downloading Polygon2-2.0.7.zip (73kB)
100% |################################| 77kB 561kB/s
Collecting numpy (from fonttools->VPython==5.74)
Downloading numpy-1.9.2.tar.gz (4.0MB)
100% |################################| 4.0MB 79kB/s
Installing collected packages: numpy, fonttools, TTFQuery, Polygon2, VPython
Running setup.py install for numpy
Complete output from command C:\Python27\python.exe -c "import setuptools, t
okenize;__file__='c:\\windows\\temp\\pip-build-2wkd41\\numpy\\setup.py';exec(com
pile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __f
ile__, 'exec'))" install --record c:\windows\temp\pip-hob8vx-record\install-reco
rd.txt --single-version-externally-managed --compile:
non-existing path in 'numpy\\distutils': 'site.cfg'
non-existing path in 'numpy\\f2py': 'docs'
non-existing path in 'numpy\\f2py': 'f2py.1'
F2PY Version 2
blas_opt_info:
blas_mkl_info:
libraries mkl,vml,guide not found in ['C:\\Python27\\lib', 'C:\\', 'C:\\Py
thon27\\libs']
NOT AVAILABLE

openblas_info:
libraries openblas not found in ['C:\\Python27\\lib', 'C:\\', 'C:\\Python2
7\\libs']
NOT AVAILABLE

atlas_3_10_blas_threads_info:
Setting PTATLAS=ATLAS
libraries tatlas not found in ['C:\\Python27\\lib', 'C:\\', 'C:\\Python27\
\libs']
NOT AVAILABLE

atlas_3_10_blas_info:
libraries satlas not found in ['C:\\Python27\\lib', 'C:\\', 'C:\\Python27\
\libs']
NOT AVAILABLE

atlas_blas_threads_info:
Setting PTATLAS=ATLAS
libraries ptf77blas,ptcblas,atlas not found in ['C:\\Python27\\lib', 'C:\\
', 'C:\\Python27\\libs']
NOT AVAILABLE

atlas_blas_info:
libraries f77blas,cblas,atlas not found in ['C:\\Python27\\lib', 'C:\\', '
C:\\Python27\\libs']
NOT AVAILABLE

blas_info:
libraries blas not found in ['C:\\Python27\\lib', 'C:\\', 'C:\\Python27\\l
ibs']
NOT AVAILABLE

blas_src_info:
NOT AVAILABLE

NOT AVAILABLE

non-existing path in 'numpy\\lib': 'benchmarks'
lapack_opt_info:
openblas_lapack_info:
libraries openblas not found in ['C:\\Python27\\lib', 'C:\\', 'C:\\Python2
7\\libs']
NOT AVAILABLE

lapack_mkl_info:
mkl_info:
libraries mkl,vml,guide not found in ['C:\\Python27\\lib', 'C:\\', 'C:\\Py
thon27\\libs']
NOT AVAILABLE

NOT AVAILABLE

atlas_3_10_threads_info:
Setting PTATLAS=ATLAS
libraries tatlas,tatlas not found in C:\Python27\lib
libraries lapack_atlas not found in C:\Python27\lib
libraries tatlas,tatlas not found in C:\
libraries lapack_atlas not found in C:\
libraries tatlas,tatlas not found in C:\Python27\libs
libraries lapack_atlas not found in C:\Python27\libs
numpy.distutils.system_info.atlas_3_10_threads_info
NOT AVAILABLE

atlas_3_10_info:
libraries satlas,satlas not found in C:\Python27\lib
libraries lapack_atlas not found in C:\Python27\lib
libraries satlas,satlas not found in C:\
libraries lapack_atlas not found in C:\
libraries satlas,satlas not found in C:\Python27\libs
libraries lapack_atlas not found in C:\Python27\libs
numpy.distutils.system_info.atlas_3_10_info
NOT AVAILABLE

atlas_threads_info:
Setting PTATLAS=ATLAS
libraries ptf77blas,ptcblas,atlas not found in C:\Python27\lib
libraries lapack_atlas not found in C:\Python27\lib
libraries ptf77blas,ptcblas,atlas not found in C:\
libraries lapack_atlas not found in C:\
libraries ptf77blas,ptcblas,atlas not found in C:\Python27\libs
libraries lapack_atlas not found in C:\Python27\libs
numpy.distutils.system_info.atlas_threads_info
NOT AVAILABLE

atlas_info:
libraries f77blas,cblas,atlas not found in C:\Python27\lib
libraries lapack_atlas not found in C:\Python27\lib
libraries f77blas,cblas,atlas not found in C:\
libraries lapack_atlas not found in C:\
libraries f77blas,cblas,atlas not found in C:\Python27\libs
libraries lapack_atlas not found in C:\Python27\libs
numpy.distutils.system_info.atlas_info
NOT AVAILABLE

lapack_info:
libraries lapack not found in ['C:\\Python27\\lib', 'C:\\', 'C:\\Python27\
\libs']
NOT AVAILABLE

lapack_src_info:
NOT AVAILABLE

NOT AVAILABLE

running install
running build
running config_cc
unifing config_cc, config, build_clib, build_ext, build commands --compiler
options
running config_fc
unifing config_fc, config, build_clib, build_ext, build commands --fcompiler
options
running build_src
build_src
building py_modules sources
creating build
creating build\src.win32-2.7
creating build\src.win32-2.7\numpy
creating build\src.win32-2.7\numpy\distutils
building library "npymath" sources
No module named msvccompiler in numpy.distutils; trying from distutils
Running from numpy source directory.
c:\windows\temp\pip-build-2wkd41\numpy\numpy\distutils\system_info.py:1603:
UserWarning:
Atlas (http://math-atlas.sourceforge.net/) libraries not found.
Directories to search for the libraries can be specified in the
numpy/distutils/site.cfg file (section [atlas]) or by setting
the ATLAS environment variable.
warnings.warn(AtlasNotFoundError.__doc__)
c:\windows\temp\pip-build-2wkd41\numpy\numpy\distutils\system_info.py:1612:
UserWarning:
Blas (http://www.netlib.org/blas/) libraries not found.
Directories to search for the libraries can be specified in the
numpy/distutils/site.cfg file (section [blas]) or by setting
the BLAS environment variable.
warnings.warn(BlasNotFoundError.__doc__)
c:\windows\temp\pip-build-2wkd41\numpy\numpy\distutils\system_info.py:1615:
UserWarning:
Blas (http://www.netlib.org/blas/) sources not found.
Directories to search for the sources can be specified in the
numpy/distutils/site.cfg file (section [blas_src]) or by setting
the BLAS_SRC environment variable.
warnings.warn(BlasSrcNotFoundError.__doc__)
c:\windows\temp\pip-build-2wkd41\numpy\numpy\distutils\system_info.py:1505:
UserWarning:
Atlas (http://math-atlas.sourceforge.net/) libraries not found.
Directories to search for the libraries can be specified in the
numpy/distutils/site.cfg file (section [atlas]) or by setting
the ATLAS environment variable.
warnings.warn(AtlasNotFoundError.__doc__)
c:\windows\temp\pip-build-2wkd41\numpy\numpy\distutils\system_info.py:1516:
UserWarning:
Lapack (http://www.netlib.org/lapack/) libraries not found.
Directories to search for the libraries can be specified in the
numpy/distutils/site.cfg file (section [lapack]) or by setting
the LAPACK environment variable.
warnings.warn(LapackNotFoundError.__doc__)
c:\windows\temp\pip-build-2wkd41\numpy\numpy\distutils\system_info.py:1519:
UserWarning:
Lapack (http://www.netlib.org/lapack/) sources not found.
Directories to search for the sources can be specified in the
numpy/distutils/site.cfg file (section [lapack_src]) or by setting
the LAPACK_SRC environment variable.
warnings.warn(LapackSrcNotFoundError.__doc__)
C:\Python27\lib\distutils\dist.py:267: UserWarning: Unknown distribution opt
ion: 'define_macros'
warnings.warn(msg)
error: Microsoft Visual C++ 9.0 is required (Unable to find vcvarsall.bat).
Get it from http://aka.ms/vcpython27

----------------------------------------
Command "C:\Python27\python.exe -c "import setuptools, tokenize;__file__='c:\\wi
ndows\\temp\\pip-build-2wkd41\\numpy\\setup.py';exec(compile(getattr(tokenize, '
open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install
--record c:\windows\temp\pip-hob8vx-record\install-record.txt --single-version-
externally-managed --compile" failed with error code 1 in c:\windows\temp\pip-bu
ild-2wkd41\numpy

■エラーが出ました!!!
MicrosoftがPython 2.7用のコンパクトなVC++ 9.0コンパイラMicrosoft Visual C++ Compiler for Python 2.7を配布しています。
Microsoftから
VCForPython27.msiをダウンロードして
インストールします。
■ここを参考にしました。ありがとうございます。
http://www.regentechlog.com/2014/04/13/build-python-package-on-windows/




仕切りなおします。再度チャレンジ!
D:\Aplication>pip install VPython-5.74-cp27-none-win32.whl
Processing d:\aplication\vpython-5.74-cp27-none-win32.whl
Collecting fonttools (from VPython==5.74)
Using cached FontTools-2.4.tar.gz
Collecting TTFQuery (from VPython==5.74)
Using cached TTFQuery-1.0.5.tar.gz
Collecting Polygon2 (from VPython==5.74)
Using cached Polygon2-2.0.7.zip
Collecting numpy (from fonttools->VPython==5.74)
Using cached numpy-1.9.2.tar.gz
Installing collected packages: numpy, fonttools, TTFQuery, Polygon2, VPython
Running setup.py install for numpy
Running setup.py install for fonttools
Running setup.py install for TTFQuery
Running setup.py install for Polygon2
Successfully installed Polygon2-2.0.7 TTFQuery-1.0.5 VPython-5.74 fonttools nump
y-1.9.2

■内容を確認します
D:\Aplication>pip freeze
cgkit==2.0.0
FontTools==2.4
numpy==1.9.2
ode==0.13.1
Pillow==2.8.2
Polygon2==2.0.7
pygame==1.9.2a0
pyglet==1.2.2
PyOpenGL==3.1.1a1
pyprocessing==0.1.3.22
TTFQuery==1.0.5
VPython==5.74

●ありがとうございます。
cgkit | - | -

Metasequoia PythonでPxrDisneyマテリアル設定

Metasequoia Pythonを使って、RenderMan RIS用のマテリアルPxrDisneyを設定してみました。ありがとうございます。
boxesrnd.jpg


import random

def p(*args):
"""
プリント関数
複数の引数を渡せる。
"""
if len(args)==0:
# 改行させる
MQSystem.println("")
return

for arg in args:
MQSystem.println(str(arg))


# 基本図形、新規オブジェクトで立方体複数つくる
#meta_cube_def_rndc.py
doc = MQSystem.getDocument()
out = MQSystem.println


#
def unitcube(L=50,x=0,y=0,z=0):
obj = MQSystem.newObject() #新規オブジェクト
num=doc.numObject
a=num
obj.name="cube_%d" % a #オブジェクト名をつける

obj.addVertex(x-L/2.0,y-L/2.0,z+L/2.0) #0 頂点番号
obj.addVertex(x+L/2.0,y-L/2.0,z+L/2.0) #1
obj.addVertex(x+L/2.0,y+L/2.0,z+L/2.0) #2
obj.addVertex(x-L/2.0,y+L/2.0,z+L/2.0) #3
obj.addVertex(x-L/2.0,y-L/2.0,z-L/2.0) #4
obj.addVertex(x-L/2.0,y+L/2.0,z-L/2.0) #5
obj.addVertex(x+L/2.0,y+L/2.0,z-L/2.0) #6
obj.addVertex(x+L/2.0,y-L/2.0,z-L/2.0) #7

obj.addFace([0,3,2,1])
obj.addFace([1,2,6,7])
obj.addFace([4,7,6,5])
obj.addFace([0,4,5,3])
obj.addFace([3,5,6,2])
obj.addFace([0,1,7,4])
doc.addObject( obj )

mat1=MQSystem.newMaterial()
doc.addMaterial(mat1) #マテリアルをドキュメントに追加
num0 = doc.numMaterial #現在の材質数を数える
numm=num0-1 #マテリアル番号は一つ少ない
doc.material[numm].shader=5
doc.material[numm].shaderFilename="PxrDisney"
doc.material[numm].color=MQSystem.newColor(random.random(),random.random(),random.random())
doc.material[numm].specular=0.5
doc.material[numm].reflection=0.75

for face in obj.face:
face.material=numm #マテリアルnumm番を面に割り当てる


import traceback
import sys
#dist=0
try:
for dist in range(0,600,200):
for dist2 in range(0,600,200):
#out(str(i))
out(str(dist))
unitcube(100,50+dist,50,dist2)



except:
info=sys.exc_info()
p(info[0])
p(info[1])
p(*traceback.extract_tb(info[2]))

num = doc.numObject #オブジェクトの数
out("オブジェクトの数 %d" % num) #オブジェクトの数を表示


Metasequoia | - | -

MagicaVoxelからFujiyama Rendererへ

Fujiyama Renderer0.2.9、MagicaVoxelからobjをexport。blenderに読み込みply出力。s,tをuv1,uv2に書き換え、textureをjpgにして読み込みました。直接jpgやplyを読み込んでます。objの表示に影が出るのでplyを使います。
magica.jpg
Magicavoxelのtextureは拡大。Magicavoxelからobj出力時のテクスチャは1 x 256pixels、変換できないので、100 x 256にしたらできました。ありがとうございます。
ch02.jpg


#!/usr/bin/env python

#set PYTHONPATH=C:\Python27;C:\Fujiyama-Renderer\python
# 1 teapot with 32 point lights
# This script is the python version of teapot.scn with minor changes.
# It also demonstrates how to load *.ply and *.hdr files
# directly without pre-conversion.
# Copyright (c) 2011-2014 Hiroshi Tsubokawa

import fujiyama

si = fujiyama.SceneInterface()

#plugins
si.OpenPlugin('PlasticShader')
si.OpenPlugin('GlassShader')
si.OpenPlugin('ConstantShader')

#Camera
si.NewCamera('cam1', 'PerspectiveCamera')
si.SetProperty3('cam1', 'translate', 0, 1, 7)
si.SetProperty3('cam1', 'rotate', -5.710593137499643, 0, 0)

#Light
si.NewLight('light0', 'PointLight')
si.SetProperty3('light0', 'translate', 0.900771, 12, 4.09137)
si.SetProperty1('light0', 'intensity', 0.03125)
si.NewLight('light1', 'PointLight')
si.SetProperty3('light1', 'translate', 2.02315, 12, 5.28021)
si.SetProperty1('light1', 'intensity', 0.03125)
si.NewLight('light2', 'PointLight')
si.SetProperty3('light2', 'translate', 10.69, 12, 13.918)
si.SetProperty1('light2', 'intensity', 0.03125)
si.NewLight('light3', 'PointLight')
si.SetProperty3('light3', 'translate', 4.28027, 12, 7.58462)
si.SetProperty1('light3', 'intensity', 0.03125)
si.NewLight('light4', 'PointLight')
si.SetProperty3('light4', 'translate', 12.9548, 12, 1.19914)
si.SetProperty1('light4', 'intensity', 0.03125)
si.NewLight('light5', 'PointLight')
si.SetProperty3('light5', 'translate', 6.55808, 12, 2.31772)
si.SetProperty1('light5', 'intensity', 0.03125)
si.NewLight('light6', 'PointLight')
si.SetProperty3('light6', 'translate', 0.169064, 12, 10.9623)
si.SetProperty1('light6', 'intensity', 0.03125)
si.NewLight('light7', 'PointLight')
si.SetProperty3('light7', 'translate', 1.25002, 12, 4.51314)
si.SetProperty1('light7', 'intensity', 0.03125)
si.NewLight('light8', 'PointLight')
si.SetProperty3('light8', 'translate', 2.46758, 12, 5.73382)
si.SetProperty1('light8', 'intensity', 0.03125)
si.NewLight('light9', 'PointLight')
si.SetProperty3('light9', 'translate', 3.55644, 12, 6.84334)
si.SetProperty1('light9', 'intensity', 0.03125)
si.NewLight('light10', 'PointLight')
si.SetProperty3('light10', 'translate', 4.76112, 12, 8.00264)
si.SetProperty1('light10', 'intensity', 0.03125)
si.NewLight('light11', 'PointLight')
si.SetProperty3('light11', 'translate', 13.3267, 12, 9.10333)
si.SetProperty1('light11', 'intensity', 0.03125)
si.NewLight('light12', 'PointLight')
si.SetProperty3('light12', 'translate', 14.4155, 12, 2.68084)
si.SetProperty1('light12', 'intensity', 0.03125)
si.NewLight('light13', 'PointLight')
si.SetProperty3('light13', 'translate', 8.10755, 12, 3.79629)
si.SetProperty1('light13', 'intensity', 0.03125)
si.NewLight('light14', 'PointLight')
si.SetProperty3('light14', 'translate', 9.21103, 12, 4.9484)
si.SetProperty1('light14', 'intensity', 0.03125)
si.NewLight('light15', 'PointLight')
si.SetProperty3('light15', 'translate', 2.83469, 12, 6.09221)
si.SetProperty1('light15', 'intensity', 0.03125)
si.NewLight('light16', 'PointLight')
si.SetProperty3('light16', 'translate', 4.00945, 12, 7.18302)
si.SetProperty1('light16', 'intensity', 0.03125)
si.NewLight('light17', 'PointLight')
si.SetProperty3('light17', 'translate', 12.6072, 12, 0.832089)
si.SetProperty1('light17', 'intensity', 0.03125)
si.NewLight('light18', 'PointLight')
si.SetProperty3('light18', 'translate', 6.21169, 12, 1.98055)
si.SetProperty1('light18', 'intensity', 0.03125)
si.NewLight('light19', 'PointLight')
si.SetProperty3('light19', 'translate', 7.39599, 12, 10.5563)
si.SetProperty1('light19', 'intensity', 0.03125)
si.NewLight('light20', 'PointLight')
si.SetProperty3('light20', 'translate', 8.52421, 12, 4.15086)
si.SetProperty1('light20', 'intensity', 0.03125)
si.NewLight('light21', 'PointLight')
si.SetProperty3('light21', 'translate', 9.5891, 12, 5.39715)
si.SetProperty1('light21', 'intensity', 0.03125)
si.NewLight('light22', 'PointLight')
si.SetProperty3('light22', 'translate', 3.18967, 12, 13.9542)
si.SetProperty1('light22', 'intensity', 0.03125)
si.NewLight('light23', 'PointLight')
si.SetProperty3('light23', 'translate', 4.41432, 12, 0.082813)
si.SetProperty1('light23', 'intensity', 0.03125)
si.NewLight('light24', 'PointLight')
si.SetProperty3('light24', 'translate', 5.48803, 12, 1.21856)
si.SetProperty1('light24', 'intensity', 0.03125)
si.NewLight('light25', 'PointLight')
si.SetProperty3('light25', 'translate', 6.57647, 12, 2.31432)
si.SetProperty1('light25', 'intensity', 0.03125)
si.NewLight('light26', 'PointLight')
si.SetProperty3('light26', 'translate', 0.265098, 12, 10.9453)
si.SetProperty1('light26', 'intensity', 0.03125)
si.NewLight('light27', 'PointLight')
si.SetProperty3('light27', 'translate', 8.84422, 12, 12.1117)
si.SetProperty1('light27', 'intensity', 0.03125)
si.NewLight('light28', 'PointLight')
si.SetProperty3('light28', 'translate', 10.0154, 12, 5.67625)
si.SetProperty1('light28', 'intensity', 0.03125)
si.NewLight('light29', 'PointLight')
si.SetProperty3('light29', 'translate', 11.0907, 12, 14.4043)
si.SetProperty1('light29', 'intensity', 0.03125)
si.NewLight('light30', 'PointLight')
si.SetProperty3('light30', 'translate', 4.71726, 12, 7.98851)
si.SetProperty1('light30', 'intensity', 0.03125)
si.NewLight('light31', 'PointLight')
si.SetProperty3('light31', 'translate', 13.3907, 12, 9.08986)
si.SetProperty1('light31', 'intensity', 0.03125)
si.NewLight('light32', 'PointLight')
si.SetProperty3('light32', 'translate', 0, 1, 7)
si.SetProperty1('light32', 'intensity', 0.75)
#Texture
# You can specify file paths to *.hdr/*.jpg file via python API
si.NewTexture('tex1', '../hdr/grace-new.hdr')
si.NewTexture('tex2', '../mip/ch02.jpg')

#Shader
si.NewShader('teapot_shader', 'PlasticShader')
si.NewShader('floor_shader', 'PlasticShader')
si.NewShader('dome_shader', 'ConstantShader')

#Mesh
# You can specify file paths to *.ply/*.obj file via python API
si.NewMesh('teapot_mesh', '../ply/sword2.ply')
si.NewMesh('floor_mesh', '../ply/floor.ply')
si.NewMesh('dome_mesh', '../ply/dome.ply')

#ObjectInstance
si.NewObjectInstance('teapot1', 'teapot_mesh')
si.SetProperty3('teapot1', 'translate', 0, -0.55, 1.5)
si.SetProperty3('teapot1', 'rotate', -90, -30, 0)
si.AssignShader('teapot1', 'teapot_shader')
si.AssignTexture('teapot_shader', 'diffuse_map', 'tex2')

si.NewObjectInstance('floor1', 'floor_mesh')
si.SetProperty3('floor1', 'translate', 0, -0.6, 0)
si.AssignShader('floor1', 'floor_shader')

si.NewObjectInstance('dome1', 'dome_mesh')
si.SetProperty3('dome1', 'scale', .5, .5, .5)
si.SetProperty3('dome1', 'rotate', 0, 30, 0)
si.AssignShader('dome1', 'dome_shader')
si.AssignTexture('dome_shader', 'texture', 'tex1')

#ObjectGroup
si.NewObjectGroup('group1')
si.AddObjectToGroup('group1', 'teapot1')
si.AssignObjectGroup('teapot1', 'shadow_target', 'group1')
si.AssignObjectGroup('floor1', 'shadow_target', 'group1')

#FrameBuffer
si.NewFrameBuffer('fb1', 'rgba')

#Renderer
si.NewRenderer('ren1')
si.AssignCamera('ren1', 'cam1')
si.AssignFrameBuffer('ren1', 'fb1')
si.SetProperty2('ren1', 'resolution', 640, 480)
#si.SetProperty2('ren1', 'resolution', 160, 120)

#Rendering
si.RenderScene('ren1')

#Output
# You can specify file paths to *.exr file via python API
si.SaveFrameBuffer('fb1', '../objimport01.exr')

#Run commands
si.Run()
#si.Print()


magica2.jpg
Fujiyama Renderer | - | -

Fujiyama Renderer 0.2.8 for Windows 64bit

Fujiyama Renderer0.2.8、メタセコイアmekaをobj→blenderでply出力。s,tをuv1,uv2に書き換え、textureをjpgにして読み込みました。直接jpgやobjやplyを読み込みできるようになったのでちょっと便利になりました。ありがとうございます。
floor.plyをblenderで読み込み、UV editingでunwrapし、obj exportしました。
teapotscn03.jpg
以下はサンプル


#!/usr/bin/env python
# -*- coding: utf-8 -*-
#export PYTHONPATH=$PYTHONPATH:/usr/lib/python2.6/site-packages/:$HOME/Fujiyama-Renderer/bin/
#set PYTHONPATH=C:\Python26;C:\Fujiyama-Renderer\python

import fujiyama
si = fujiyama.SceneInterface()

#plugins
si.OpenPlugin('ConstantShader')
si.OpenPlugin('PlasticShader')
si.OpenPlugin('GlassShader')


#Camera
si.NewCamera('cam1', 'PerspectiveCamera')
si.SetProperty3('cam1', 'rotate', -20, 0.00, 0.00)
si.SetProperty3('cam1', 'translate', 0.00, 6.00, 7.00)
si.SetProperty1('cam1', 'fov', 45)

#Light
si.NewLight( 'light0', 'PointLight')
si.SetProperty3( 'light0', 'translate', 0.900771, 12, 4.09137)
si.SetProperty1( 'light0', 'intensity', 0.03125)
si.NewLight( 'light1', 'PointLight')
si.SetProperty3( 'light1', 'translate', 2.02315, 12, 5.28021)
si.SetProperty1( 'light1' ,'intensity', 0.03125)
si.NewLight( 'light2', 'PointLight')
si.SetProperty3( 'light2', 'translate', 10.69, 12, 13.918)
si.SetProperty1( 'light2', 'intensity', 0.03125)
si.NewLight( 'light3', 'PointLight')
si.SetProperty3( 'light3', 'translate', 4.28027, 12, 7.58462)
si.SetProperty1( 'light3', 'intensity', 0.03125)
si.NewLight( 'light4', 'PointLight')
si.SetProperty3( 'light4', 'translate', 12.9548, 12, 1.19914)
si.SetProperty1( 'light4', 'intensity', 0.03125)
si.NewLight( 'light5', 'PointLight')
si.SetProperty3( 'light5', 'translate', 6.55808, 12, 2.31772)
si.SetProperty1( 'light5', 'intensity', 0.03125)
si.NewLight( 'light6', 'PointLight')
si.SetProperty3( 'light6', 'translate', 0.169064, 12, 10.9623)
si.SetProperty1( 'light6', 'intensity', 0.03125)
si.NewLight( 'light7', 'PointLight')
si.SetProperty3( 'light7', 'translate', 1.25002, 12, 4.51314)
si.SetProperty1( 'light7', 'intensity', 0.03125)
si.NewLight( 'light8', 'PointLight')
si.SetProperty3( 'light8', 'translate', 2.46758, 12, 5.73382)
si.SetProperty1( 'light8', 'intensity', 0.03125)
si.NewLight( 'light9', 'PointLight')
si.SetProperty3( 'light9', 'translate', 3.55644, 12, 6.84334)
si.SetProperty1( 'light9','intensity', 0.03125)
si.NewLight( 'light10', 'PointLight')
si.SetProperty3( 'light10', 'translate', 4.76112, 12, 8.00264)
si.SetProperty1( 'light10', 'intensity', 0.03125)
si.NewLight( 'light11', 'PointLight')
si.SetProperty3( 'light11', 'translate', 13.3267,12, 9.10333)
si.SetProperty1( 'light11', 'intensity', 0.03125)
si.NewLight( 'light12', 'PointLight')
si.SetProperty3( 'light12', 'translate', 14.4155, 12, 2.68084)
si.SetProperty1( 'light12', 'intensity', 0.03125)
si.NewLight( 'light13', 'PointLight')
si.SetProperty3( 'light13', 'translate', 8.10755, 12, 3.79629)
si.SetProperty1( 'light13', 'intensity', 0.03125)
si.NewLight( 'light14', 'PointLight')
si.SetProperty3( 'light14', 'translate', 9.21103, 12, 4.9484)
si.SetProperty1( 'light14', 'intensity', 0.03125)
si.NewLight( 'light15', 'PointLight')
si.SetProperty3( 'light15', 'translate', 2.83469, 12, 6.09221)
si.SetProperty1( 'light15', 'intensity', 0.03125)
si.NewLight( 'light16', 'PointLight')
si.SetProperty3( 'light16', 'translate', 4.00945, 12, 7.18302)
si.SetProperty1( 'light16', 'intensity', 0.03125)
si.NewLight( 'light17', 'PointLight')
si.SetProperty3( 'light17', 'translate', 12.6072, 12, 0.832089)
si.SetProperty1( 'light17', 'intensity', 0.03125)
si.NewLight( 'light18', 'PointLight')
si.SetProperty3( 'light18', 'translate', 6.21169, 12, 1.98055)
si.SetProperty1( 'light18', 'intensity', 0.03125)
si.NewLight( 'light19', 'PointLight')
si.SetProperty3( 'light19', 'translate', 7.39599, 12, 10.5563)
si.SetProperty1( 'light19', 'intensity', 0.03125)
si.NewLight( 'light20', 'PointLight')
si.SetProperty3( 'light20', 'translate', 8.52421, 12, 4.15086)
si.SetProperty1( 'light20', 'intensity', 0.03125)
si.NewLight( 'light21', 'PointLight')
si.SetProperty3( 'light21', 'translate', 9.5891, 12, 5.39715)
si.SetProperty1( 'light21', 'intensity', 0.03125)
si.NewLight( 'light22', 'PointLight')
si.SetProperty3( 'light22', 'translate', 3.18967, 12, 13.9542)
si.SetProperty1( 'light22', 'intensity', 0.03125)
si.NewLight( 'light23','PointLight')
si.SetProperty3( 'light23', 'translate', 4.41432, 12, 0.082813)
si.SetProperty1( 'light23', 'intensity', 0.03125)
si.NewLight( 'light24', 'PointLight')
si.SetProperty3( 'light24', 'translate', 5.48803, 12, 1.21856)
si.SetProperty1( 'light24', 'intensity', 0.03125)
si.NewLight( 'light25', 'PointLight')
si.SetProperty3( 'light25', 'translate', 6.57647, 12, 2.31432)
si.SetProperty1( 'light25', 'intensity', 0.03125)
si.NewLight( 'light26', 'PointLight')
si.SetProperty3( 'light26', 'translate', 0.265098, 12, 10.9453)
si.SetProperty1( 'light26', 'intensity', 0.03125)
si.NewLight( 'light27', 'PointLight')
si.SetProperty3( 'light27', 'translate', 8.84422, 12, 12.1117)
si.SetProperty1( 'light27', 'intensity', 0.03125)
si.NewLight( 'light28', 'PointLight')
si.SetProperty3( 'light28', 'translate', 10.0154, 12, 5.67625)
si.SetProperty1( 'light28', 'intensity', 0.03125)
si.NewLight( 'light29', 'PointLight')
si.SetProperty3( 'light29', 'translate', 11.0907, 12, 14.4043)
si.SetProperty1( 'light29', 'intensity', 0.03125)
si.NewLight( 'light30', 'PointLight')
si.SetProperty3( 'light30', 'translate', 4.71726, 12, 7.98851)
si.SetProperty1( 'light30', 'intensity', 0.03125)
si.NewLight( 'light31', 'PointLight')
si.SetProperty3( 'light31', 'translate', 13.3907, 12, 9.08986)
si.SetProperty1( 'light31', 'intensity', 0.03125)

#Texture
si.NewTexture( 'tex1', '../hdr/ennis.hdr')
si.NewTexture('tex2', '../hdr/uvmap.jpg')
si.NewTexture('tex3', '../hdr/00tex_master.jpg')


#Shader
si.NewShader('teapot_shader', 'PlasticShader')
si.NewShader('floor_shader', 'PlasticShader')
si.NewShader('dome_shader', 'ConstantShader')


#Mesh
si.NewMesh('teapot_mesh', '../ply/meka.ply')
si.NewMesh('floor_mesh', '../ply/floor3.obj')
si.NewMesh('dome_mesh', '../ply/dome.ply')


#ObjectInstance
si.NewObjectInstance('teapot1','teapot_mesh')
si.SetProperty3('teapot1', 'translate', 0, 0, -2)
si.SetProperty3('teapot1', 'scale', 1.6, 1.6, 1.6)
si.AssignShader('teapot1','teapot_shader')
si.AssignTexture('teapot_shader', 'diffuse_map', 'tex3')


si.NewObjectInstance('floor1','floor_mesh')
si.SetProperty3('floor1','translate', 0, 0, -2.5)
si.SetProperty3('floor1','scale', .6, .6, .6)
si.SetProperty3('floor1','rotate', 90, 0, 0)
si.AssignShader('floor1','floor_shader')
si.AssignTexture('floor_shader', 'diffuse_map', 'tex2')

si.NewObjectInstance('dome1','dome_mesh')
si.SetProperty3( 'dome1', 'scale', .5, .5, .5)
si.SetProperty3( 'dome1', 'rotate', 0 ,135, 0)
si.AssignShader( 'dome1', 'dome_shader')
si.AssignTexture( 'dome_shader' ,'texture', 'tex1')

#ObjectGroup
si.NewObjectGroup( 'group1')
si.AddObjectToGroup( 'group1', 'teapot1')
si.AssignObjectGroup( 'teapot1','shadow_target', 'group1')
si.AssignObjectGroup( 'floor1','shadow_target', 'group1')


#FrameBuffer
si.NewFrameBuffer('fb1', 'rgba')

#Properties
si.ShowPropertyList('Renderer')

#Renderer
si.NewRenderer('ren1')
si.AssignCamera('ren1', 'cam1')
si.AssignFrameBuffer('ren1', 'fb1')
#si.SetProperty2('ren1', 'resolution', 1024, 600)
si.SetProperty2('ren1', 'resolution', 512, 300)
#si.SetProperty2('ren1', 'resolution', 160, 120)


si.SetProperty1('ren1', 'raymarch_step', .01)
si.SetProperty1('ren1', 'raymarch_shadow_step', .02)
si.SetProperty1('ren1', 'raymarch_reflect_step', .02)


#Rendering
si.RenderScene('ren1')

#Output
si.SaveFrameBuffer('fb1', '../teapotscn03.exr')

#Run commands

si.Run()
#si.Print()




ありがとうございます。
Fujiyama Renderer | - | -

Python3.3 and cgkit install for Windows7 32bit

cgkitをPython3.3環境、Windows7 32bit環境にインストールしてみました。少し難がありますが
何とか動きます。
cgkitはPython2.6や2.7環境では問題なく動きます。PyProtocolのインストールが面倒なだけでした。
Python3環境ではPyProtocolが必要なくなり、インストールが簡単になりましたが、微調整が必要なところです。
Python環境とRenderMan互換レンダラー(Pixie)をインストールしていきましょう。

■以下をWindows7 32bit環境にインストールします。
 python-3.3.5.msi
 cgkit-2.0.0.win32-py3.3.exe
 pygame-1.9.2a0-hg_56e0eadfc267.win32-py3.3.msi
 PyOpenGL-3.1.0.win32.exe
 ode-0.13.1.win32-py3.3.exe
 Pillow-2.5.0.win32-py3.3.exe
 numpy-1.9.0b1-win32-superpack-python3.3.exe

だいたいのバイナリデータはこちらからダウンロードしました。
http://www.lfd.uci.edu/~gohlke/pythonlibs/

■インストールが終わったら、Python3.3の環境設定です。
コンピュータ右クリック→プロパティ→システムの詳細設定→環境変数→システム環境変数内のPATHをクリック→「編集」をクリック
変数値の行の最後に以下のパスを記入します。

;C:\Python33;C:\Python33\Scripts;

■再起動します。

■サンプルをcgkitのチュートリアルページからscriptをとってきます。
http://cgkit.sourceforge.net/tutorials/demo1.html

■OpenGL表示のviewerを起動してみましょう。
D:\Aplication\cgkit>viewer.py demo1.py
Traceback (most recent call last):
File "C:\Python33\Scripts\viewer.py", line 699, in
viewer.run()
File "C:\Python33\lib\site-packages\cgkit\tool.py", line 198, in run
self.action()
File "C:\Python33\Scripts\viewer.py", line 389, in action
self.handleEvents(events)
File "C:\Python33\Scripts\viewer.py", line 424, in handleEvents
key = e.str
AttributeError: 'Event' object has no attribute 'str'

■画面は表示されますが、altキーを押して画面操作をしようとするとウインドウが閉じてしまい、
エラーが表示されます。

■ここでエディタを使ってviewer.pyの424行を変更します。
key = e.str

key = e.unicode
に変更してください。

■再度viewerを動かすとできます。
D:\Aplication\cgkit>viewer.py demo1.py

■続いてレンダリングをやってみましょう。事前に3delightをインストールしておきましょう。
32bit版3Delightはなくなっていました。ここではPixie Renderer(2009年開発停止)を利用します。
http://sourceforge.net/projects/pixie/files/
Pixie-2.2.6-Setup.exeをダウンロードしインストールします。

■シェーダコンパイラsdrcが
「このアプリケーションのサイド バイ サイド構成が正しくないため、アプリケーションを
開始できませんでした。詳細については、アプリケーションのイベント ログを参照する
か、コマンド ライン ツール sxstrace.exe を使用してください。」
と出るので、2010年にビルドしたPixie_2010-05-25_Win32.zipをダウンロードします。
https://github.com/scorpion007/pixie/downloads
解凍して、C:\Program Files\pixieフォルダの中身と入れ替えます。
uninstall.dat等はそのままにしておきます。

■cgkitでサンプルをPixieを使ってレンダリングしてみましょう。
D:\Aplication\cgkit>render.py -rpixie demo1.py
Exporting main.rib...
Traceback (most recent call last):
File "C:\Python33\Scripts\render.py", line 361, in
render.run()
File "C:\Python33\lib\site-packages\cgkit\tool.py", line 198, in run
self.action()
File "C:\Python33\Scripts\render.py", line 237, in action
bakestvar = bakestvar
File "C:\Python33\lib\site-packages\cgkit\cmds.py", line 981, in save
exp.exportFile(os.path.basename(filename), **options)
File "C:\Python33\lib\site-packages\cgkit\ribexport.py", line 172, in exportFi
le
explgt = self.adapt(obj, ILightSource)
File "C:\Python33\lib\site-packages\cgkit\ribexport.py", line 672, in adapt
return protocols.adapt(obj, interface)
File "C:\Python33\lib\site-packages\cgkit\protocols.py", line 53, in adapt
if interfaces.has_key(interface):
AttributeError: 'dict' object has no attribute 'has_key'

とエラーが出ます。
C:\Python33\Lib\site-packages\cgkit\protocols.pyをエディタで開きます。
53行目を変更します。
if interfaces.has_key(interface):

if interface in interfaces:
protocols.pyを保存します。

■再度レンダリングします。
D:\Aplication\cgkit>render.py -rpixie demo1.py
Exporting main.rib...
1 passes...
Traceback (most recent call last):
File "C:\Python33\Scripts\render.py", line 361, in
render.run()
File "C:\Python33\lib\site-packages\cgkit\tool.py", line 198, in run
self.action()
File "C:\Python33\Scripts\render.py", line 237, in action
bakestvar = bakestvar
File "C:\Python33\lib\site-packages\cgkit\cmds.py", line 981, in save
exp.exportFile(os.path.basename(filename), **options)
File "C:\Python33\lib\site-packages\cgkit\ribexport.py", line 280, in exportFi
le
rpass.doPass(frameNr)
File "C:\Python33\lib\site-packages\cgkit\ribexport.py", line 832, in doPass
lid = self.exporter.applyLightSource(lgt)
File "C:\Python33\lib\site-packages\cgkit\ribexport.py", line 364, in applyLig
htSource
explgt.shaderSource())
File "C:\Python33\lib\site-packages\cgkit\ribexport.py", line 557, in writeSha
der
f = file(filename, "wt")
NameError: global name 'file' is not defined

とエラーが出ます。
C:\Python33\lib\site-packages\cgkit\ribexport.pyをエディタで開きます。
557行を変更します。
f = file(filename, "wt")

f = open(filename, "wt")
ribexport.pyを保存します。

■再度レンダリングすると無事に黄色の球体が表示されます。
D:\Aplication\cgkit>render.py -rpixie demo1.py
Exporting main.rib...
1 passes...
Compiling shaders...
Compiling glmaterial.sl
Compiling glpointlight.sl
Preprocessing time: 1s
Rendering "out.tif" (frame 0)...
Rendering time: 7s

■テクスチャがあるサンプルをレンダリングしてみましょう。調整が必要です。
以下からサンプルをダウンロードします。(simplescene.py, uvmap.png)
http://cgkit.sourceforge.net/tutorials/renderman.html

■レンダリングしてみます。
D:\Aplication\cgkit>render.py -r3delight simplescene.py
Exporting main.rib...
3 passes...
Converting "uvmap.png"
Traceback (most recent call last):
File "C:\Python33\Scripts\render.py", line 361, in
render.run()
File "C:\Python33\lib\site-packages\cgkit\tool.py", line 198, in run
self.action()
File "C:\Python33\Scripts\render.py", line 237, in action
bakestvar = bakestvar
File "C:\Python33\lib\site-packages\cgkit\cmds.py", line 981, in save
exp.exportFile(os.path.basename(filename), **options)
File "C:\Python33\lib\site-packages\cgkit\ribexport.py", line 271, in exportFi
le
rpass.doPass(frameNr)
File "C:\Python33\lib\site-packages\cgkit\ribexport.py", line 1267, in doPass
self.copyImageMap(map)
File "C:\Python33\lib\site-packages\cgkit\ribexport.py", line 1297, in copyIma
geMap
img = Image.open(texmap)
NameError: global name 'Image' is not defined

PILがないということなので
C:\Python33\lib\site-packages\cgkit\ribexport.pyをエディタで開きます。

68行目あたりに追加行。
from PIL import Image
を加えます。

■再度レンダリングします。できました。
D:\Aplication\cgkit>render.py -rpixie simplescene.py
Exporting main.rib...
3 passes...
Converting "uvmap.png"
Compiling shaders...
Compiling gldistantlight.sl
Compiling glmaterial.sl
Compiling glpointlight.sl
Compiling glspotlight.sl
Preprocessing time: 0s
Rendering "out.tif" (frame 0)...
Rendering time: 6s


Windows7 32bitとPython3.3環境でのcgkit関連のインストールは
まだ課題があります。テクスチャを貼ったviewer.pyがPILとうまくつながってくれません
D:\Aplication\cgkit>viewer.py simplescene.py
Texname: 1
Loading "uvmap.png"... Traceback (most recent call last):
File "C:\Python33\Scripts\viewer.py", line 699, in
viewer.run()
File "C:\Python33\lib\site-packages\cgkit\tool.py", line 198, in run
self.action()
File "C:\Python33\Scripts\viewer.py", line 384, in action
self.draw(self.cam, self.width, self.height)
File "C:\Python33\Scripts\viewer.py", line 676, in draw
renderer.paint(root)
File "C:\Python33\lib\site-packages\cgkit\glmaterial.py", line 104, in loadTe
Data
img = Image.open(fullname)
File "C:\Python33\lib\site-packages\cgkit\_Image.py", line 148, in open
raise ImportError("No module named Image. Please install PIL (http://www.py
honware.com/products/pil/index.htm).")
ImportError: No module named Image. Please install PIL (http://www.pythonware.c
m/products/pil/index.htm).

D:\Aplication\cgkit>viewer.py simplescene.py
Texname: 1
Loading "uvmap.png"... Traceback (most recent call last):
File "C:\Python33\Scripts\viewer.py", line 699, in
viewer.run()
File "C:\Python33\lib\site-packages\cgkit\tool.py", line 198, in run
self.action()
File "C:\Python33\Scripts\viewer.py", line 384, in action
self.draw(self.cam, self.width, self.height)
File "C:\Python33\Scripts\viewer.py", line 676, in draw
renderer.paint(root)
File "C:\Python33\lib\site-packages\cgkit\glmaterial.py", line 104, in loadTe
Data
img = Image.open(fullname)
AttributeError: 'module' object has no attribute 'open'

他objのインポートなど微調整が必要です。
引き続き、検証します。
ありがとうございます。
cgkit | - | -

cgkit works under CentOS6.2 on virtualbox

Hello,
I installed cgkit under CentOS6.2 on virtualbox
2012-02-12 03:54:34

# uname -a
Linux 2.6.32-220.4.1.el6.i686

following are:
1.boost
Installed: boost-devel-1.41.0-11.el6_1.2.i686

2.gcc
# yum install gcc

Installed: kernel-headers-2.6.32-220.4.1.el6.i686
Updated: glibc-common-2.12-1.47.el6_2.5.i686
Updated: glibc-2.12-1.47.el6_2.5.i686
Installed: glibc-headers-2.12-1.47.el6_2.5.i686
Installed: glibc-devel-2.12-1.47.el6_2.5.i686
Installed: mpfr-2.4.1-6.el6.i686
Installed: cpp-4.4.6-3.el6.i686
Installed: ppl-0.10.2-11.el6.i686
Installed: cloog-ppl-0.15.7-1.2.el6.i686
Installed: gcc-4.4.6-3.el6.i686

3.freeglut
# yum install freeglut3
Installed: freeglut-2.6.0-1.el6.i686

4.cmake
Installed: cmake-2.6.4-5.el6.i686

5.# yum --enablerepo=epel install fltk
Installed: fltk-1.1.10-1.el6.i686

6.# yum --enablerepo=epel install aqsis
Installed: ilmbase-1.0.1-6.1.el6.i686
Installed: OpenEXR-libs-1.6.1-8.1.el6.i686
Installed: tinyxml-2.6.1-1.el6.i686
Installed: aqsis-libs-1.6.0-3.el6.i686
Installed: aqsis-core-1.6.0-3.el6.i686
Installed: aqsis-data-1.6.0-3.el6.noarch
Installed: aqsis-1.6.0-3.el6.i686


7.freeglut-devel
Installed: xorg-x11-proto-devel-7.6-13.el6.noarch
Installed: libXau-devel-1.0.5-1.el6.i686
Installed: libxcb-devel-1.5-1.el6.i686
Installed: libXdmcp-devel-1.0.3-1.el6.i686
Installed: libX11-devel-1.3-2.el6.i686
Installed: libXext-devel-1.1-3.el6.i686
Installed: libXfixes-devel-4.0.4-1.el6.i686
Installed: libXdamage-devel-1.1.2-1.el6.i686
Installed: libXxf86vm-devel-1.1.0-1.el6.i686
Installed: libdrm-devel-2.4.25-2.el6.i686
Installed: mesa-libGL-devel-7.11-3.el6.i686
Installed: mesa-libGLU-devel-7.11-3.el6.i686
Installed: freeglut-devel-2.6.0-1.el6.i686

8.
Installed: python-setuptools-0.6.10-3.el6.noarch
Installed: libgfortran-4.4.6-3.el6.i686
Installed: python-nose-0.10.4-3.1.el6.noarch
Installed: atlas-3.8.4-1.el6.i686
Installed: numpy-1.3.0-6.2.el6.i686
Installed: PyOpenGL-3.0.0-2.1.el6.noarch

9.
Installed: python-imaging-1.1.6-19.el6.i686

Download:Pyserials
http://pypi.python.org/pypi/pyserial
pyserial-2.6.tar.gz
# python setup.py install

10.
Installed: libstdc++-devel-4.4.6-3.el6.i686
Installed: compat-libstdc++-33-3.2.3-69.el6.i686

11.pygame
Installed: portmidi-217-3.el6.i686
Installed: SDL_image-1.2.10-1.el6.rf.i686
Installed: SDL_ttf-2.0.9-6.el6.i686
Installed: SDL_mixer-1.2.11-3.el6.i686
Installed: pygame-1.9.1-4.el6.i686

12.
Installed: gcc-c++-4.4.6-3.el6.i686

13.
Installed: ode-0.11.1-2.el6.i686
Installed: ode-devel-0.11.1-2.el6.i686
Installed: compat-libstdc++-296-2.96-144.el6.i686
Installed: Pyrex-0.9.8

14.
Installed: python-devel-2.6.6-29.el6.i686
Download PyODE
# python setup.py build
# python setup.py install

15.
Installed: scons-1.2.0-2.el6.rfx.noarch

16.
Installed: autoconf-2.63-5.1.el6.noarch
Installed: automake-1.11.1-1.2.el6.noarch

17.
Download PyProtocols
# python setup.py --without-speedups install

18.
Download cgkit-2.0.0alpha9.tar.gz
# cd cgkit-2.0.0alpha9/
# cd supportlib/
# scons
# cd ..
# python setup.py build
# python setup.py install
# cd utilities/
# python checkenv.py
----------------------------------------------------------------------
Python 2.6.6 (r266:84292, Dec 7 2011, 20:38:36)
[GCC 4.4.6 20110731 (Red Hat 4.4.6-3)]
Platform: linux2
----------------------------------------------------------------------
Python version: 2.6........... OK
PyProtocols................... is installed
PyOpenGL...................... is installed
PIL........................... is installed
pygame........................ is installed
PyODE......................... is installed
PySerial...................... is installed
cgkit (base).................. 2.0.0alpha9 (Feb 10 2012, 20:34)
cgkit (C++ lib)............... OK
cgkit (all)................... OK

render.py -r3delight simplescene.py
OK.

viewer.py -N softimage demo1.py
OK.

but
Navigation mode (Default: Maya) does not work.
As long as it works, I wouldn't worry about it.
CentOSのウィンドウ設定でAltキーをWindows keyに変更したらできました。

Thank you.
Yuichirou Yokomakura
cgkit | - | -

Fujiyama Renderer 0.2.3 for Windows7 64bit

Fujiyama is free and open source, distribution oriented ray-tracing renderer

Windows 64bit Binary
http://fujiyama-renderer.com/downloads.html

Download Fujiyama-Renderer-for-Win-v0.2.3-x64.zip

Create C:\Fujiyama-Renderer folder.

コンピュータ右クリック→プロパティ→システムの詳細設定→環境変数→システム環境変数内のPATHをクリック→「編集」をクリック
変数値の行の最後に以下のパスを記入します。

;C:\Fujiyama-Renderer\bin;

clip-1.jpg

Fujiyama-Rendererフォルダ内にmeshフォルダ、mipフォルダを作ります。
PLY Dataをダウンロードします。meshフォルダにモデルデータを入れます。
dome.ply
floor.ply
teapot.ply


コマンドプロンプトより
>ply2mesh dome.ply dome.mesh
>ply2mesh floor.ply floor.mesh
>ply2mesh teapot.ply teapot.mesh

モデルデータをmeshに変換しました。

次にHDRファイルをダウンロードします。
http://gl.ict.usc.edu/Data/HighResProbes/
glacier.hdr
grace-new.hdr
をダウンロードします。mipフォルダに入れます。

コマンドプロンプトより
>hdr2mip glacier.hdr glacier.mip
>hdr2mip grace-new.hdr grace-new.mip

HDRファイルをmipファイルに変換しました。

続いてsceneフォルダのシーンをレンダリングしてみましょう。
エディタでteapot.scnを開きます。
113行目
NewTexture tex1 ../../mip/grace-new.mip

NewTexture tex1 ../mip/grace-new.mip
に変更。

123行目
NewMesh teapot_mesh ../../mesh/teapot.mesh
NewMesh floor_mesh ../../mesh/floor.mesh
NewMesh dome_mesh ../../mesh/dome.mesh

NewMesh teapot_mesh ../mesh/teapot.mesh
NewMesh floor_mesh ../mesh/floor.mesh
NewMesh dome_mesh ../mesh/dome.mesh
に変更し保存します。

レンダリングします。
sceneフォルダからコマンドプロンプトを使って
>scene teapot.scn

C:\Fujiyama-Renderer\scenes>scene teapot.scn
-- OpenPlugin: [PlasticShader]
-- OpenPlugin: [GlassShader]
-- OpenPlugin: [ConstantShader]
-- NewCamera: [cam1] [PerspectiveCamera]
-- SetProperty3: [cam1] [translate] [0] [1] [7]
-- SetProperty3: [cam1] [rotate] [-5.710593137499643] [0] [0]
-- NewLight: [light0] [PointLight]
-- SetProperty3: [light0] [translate] [0.900771] [12] [4.09137]
-- SetProperty1: [light0] [intensity] [0.03125]
-- NewLight: [light1] [PointLight]
-- SetProperty3: [light1] [translate] [2.02315] [12] [5.28021]
-- SetProperty1: [light1] [intensity] [0.03125]
-- NewLight: [light2] [PointLight]
-- SetProperty3: [light2] [translate] [10.69] [12] [13.918]
-- SetProperty1: [light2] [intensity] [0.03125]
-- NewLight: [light3] [PointLight]
-- SetProperty3: [light3] [translate] [4.28027] [12] [7.58462]
-- SetProperty1: [light3] [intensity] [0.03125]
-- NewLight: [light4] [PointLight]
-- SetProperty3: [light4] [translate] [12.9548] [12] [1.19914]
-- SetProperty1: [light4] [intensity] [0.03125]
-- NewLight: [light5] [PointLight]
-- SetProperty3: [light5] [translate] [6.55808] [12] [2.31772]
-- SetProperty1: [light5] [intensity] [0.03125]
-- NewLight: [light6] [PointLight]
-- SetProperty3: [light6] [translate] [0.169064] [12] [10.9623]
-- SetProperty1: [light6] [intensity] [0.03125]
-- NewLight: [light7] [PointLight]
-- SetProperty3: [light7] [translate] [1.25002] [12] [4.51314]
-- SetProperty1: [light7] [intensity] [0.03125]
-- NewLight: [light8] [PointLight]
-- SetProperty3: [light8] [translate] [2.46758] [12] [5.73382]
-- SetProperty1: [light8] [intensity] [0.03125]
-- NewLight: [light9] [PointLight]
-- SetProperty3: [light9] [translate] [3.55644] [12] [6.84334]
-- SetProperty1: [light9] [intensity] [0.03125]
-- NewLight: [light10] [PointLight]
-- SetProperty3: [light10] [translate] [4.76112] [12] [8.00264]
-- SetProperty1: [light10] [intensity] [0.03125]
-- NewLight: [light11] [PointLight]
-- SetProperty3: [light11] [translate] [13.3267] [12] [9.10333]
-- SetProperty1: [light11] [intensity] [0.03125]
-- NewLight: [light12] [PointLight]
-- SetProperty3: [light12] [translate] [14.4155] [12] [2.68084]
-- SetProperty1: [light12] [intensity] [0.03125]
-- NewLight: [light13] [PointLight]
-- SetProperty3: [light13] [translate] [8.10755] [12] [3.79629]
-- SetProperty1: [light13] [intensity] [0.03125]
-- NewLight: [light14] [PointLight]
-- SetProperty3: [light14] [translate] [9.21103] [12] [4.9484]
-- SetProperty1: [light14] [intensity] [0.03125]
-- NewLight: [light15] [PointLight]
-- SetProperty3: [light15] [translate] [2.83469] [12] [6.09221]
-- SetProperty1: [light15] [intensity] [0.03125]
-- NewLight: [light16] [PointLight]
-- SetProperty3: [light16] [translate] [4.00945] [12] [7.18302]
-- SetProperty1: [light16] [intensity] [0.03125]
-- NewLight: [light17] [PointLight]
-- SetProperty3: [light17] [translate] [12.6072] [12] [0.832089]
-- SetProperty1: [light17] [intensity] [0.03125]
-- NewLight: [light18] [PointLight]
-- SetProperty3: [light18] [translate] [6.21169] [12] [1.98055]
-- SetProperty1: [light18] [intensity] [0.03125]
-- NewLight: [light19] [PointLight]
-- SetProperty3: [light19] [translate] [7.39599] [12] [10.5563]
-- SetProperty1: [light19] [intensity] [0.03125]
-- NewLight: [light20] [PointLight]
-- SetProperty3: [light20] [translate] [8.52421] [12] [4.15086]
-- SetProperty1: [light20] [intensity] [0.03125]
-- NewLight: [light21] [PointLight]
-- SetProperty3: [light21] [translate] [9.5891] [12] [5.39715]
-- SetProperty1: [light21] [intensity] [0.03125]
-- NewLight: [light22] [PointLight]
-- SetProperty3: [light22] [translate] [3.18967] [12] [13.9542]
-- SetProperty1: [light22] [intensity] [0.03125]
-- NewLight: [light23] [PointLight]
-- SetProperty3: [light23] [translate] [4.41432] [12] [0.082813]
-- SetProperty1: [light23] [intensity] [0.03125]
-- NewLight: [light24] [PointLight]
-- SetProperty3: [light24] [translate] [5.48803] [12] [1.21856]
-- SetProperty1: [light24] [intensity] [0.03125]
-- NewLight: [light25] [PointLight]
-- SetProperty3: [light25] [translate] [6.57647] [12] [2.31432]
-- SetProperty1: [light25] [intensity] [0.03125]
-- NewLight: [light26] [PointLight]
-- SetProperty3: [light26] [translate] [0.265098] [12] [10.9453]
-- SetProperty1: [light26] [intensity] [0.03125]
-- NewLight: [light27] [PointLight]
-- SetProperty3: [light27] [translate] [8.84422] [12] [12.1117]
-- SetProperty1: [light27] [intensity] [0.03125]
-- NewLight: [light28] [PointLight]
-- SetProperty3: [light28] [translate] [10.0154] [12] [5.67625]
-- SetProperty1: [light28] [intensity] [0.03125]
-- NewLight: [light29] [PointLight]
-- SetProperty3: [light29] [translate] [11.0907] [12] [14.4043]
-- SetProperty1: [light29] [intensity] [0.03125]
-- NewLight: [light30] [PointLight]
-- SetProperty3: [light30] [translate] [4.71726] [12] [7.98851]
-- SetProperty1: [light30] [intensity] [0.03125]
-- NewLight: [light31] [PointLight]
-- SetProperty3: [light31] [translate] [13.3907] [12] [9.08986]
-- SetProperty1: [light31] [intensity] [0.03125]
-- NewTexture: [tex1] [../mip/grace-new.mip]
-- NewShader: [teapot_shader] [GlassShader]
-- NewShader: [floor_shader] [PlasticShader]
-- NewShader: [dome_shader] [ConstantShader]
-- NewMesh: [teapot_mesh] [../mesh/teapot.mesh]
-- NewMesh: [floor_mesh] [../mesh/floor.mesh]
-- NewMesh: [dome_mesh] [../mesh/dome.mesh]
-- NewObjectInstance: [teapot1] [teapot_mesh]
-- AssignShader: [teapot1] [teapot_shader]
-- NewObjectInstance: [floor1] [floor_mesh]
-- SetProperty3: [floor1] [translate] [-2] [0] [-2]
-- AssignShader: [floor1] [floor_shader]
-- NewObjectInstance: [dome1] [dome_mesh]
-- SetProperty3: [dome1] [scale] [.5] [.5] [.5]
-- SetProperty3: [dome1] [rotate] [0] [30] [0]
-- AssignShader: [dome1] [dome_shader]
-- AssignTexture: [dome_shader] [texture] [tex1]
-- NewObjectGroup: [group1]
-- AddObjectToGroup: [group1] [teapot1]
-- AssignObjectGroup: [teapot1] [shadow_target] [group1]
-- AssignObjectGroup: [floor1] [shadow_target] [group1]
-- NewFrameBuffer: [fb1] [rgba]
-- NewRenderer: [ren1]
-- AssignCamera: [ren1] [cam1]
-- AssignFrameBuffer: [ren1] [fb1]
-- SetProperty2: [ren1] [resolution] [640] [480]
-- RenderScene: [ren1]

# Building Accelerators
# Accelerator Count: 8
# Building Accelerators Done
# 0h 0m 1s

# Preprocessing Lights
# Light Count: 32
# Preprocessing Lights Done
# 0h 0m 1s

# Rendering Frame
# Thread Count: 12
# Tile Count: 80

....1....2....3....4....5....6....7....8....9....0
-------------------------------------------------- 10% (0h 0m 1s)
....1....2....3....4....5....6....7....8....9....0
-------------------------------------------------- 20% (0h 0m 1s)
....1....2....3....4....5....6....7....8....9....0
-------------------------------------------------- 30% (0h 0m 1s)
....1....2....3....4....5....6....7....8....9....0
-------------------------------------------------- 40% (0h 0m 1s)
....1....2....3....4....5....6....7....8....9....0
-------------------------------------------------- 50% (0h 0m 2s)
....1....2....3....4....5....6....7....8....9....0
-------------------------------------------------- 60% (0h 0m 5s)
....1....2....3....4....5....6....7....8....9....0
-------------------------------------------------- 70% (0h 0m 10s)
....1....2....3....4....5....6....7....8....9....0
-------------------------------------------------- 80% (0h 0m 11s)
....1....2....3....4....5....6....7....8....9....0
-------------------------------------------------- 90% (0h 0m 12s)
....1....2....3....4....5....6....7....8....9....0
-------------------------------------------------- 100% (0h 0m 16s)

# Frame Done
# 0h 0m 16s

-- SaveFrameBuffer: [fb1] [../teapot.fb]

画像を確認します。コマンドプロンプトを使って
>fbview ../teapot.fb

ウインドウを広くしてあげると良いです。
clip-2.jpg

OpenEXRファイルに変換するには、変換したいfbファイルがある場所で
コマンドプロンプトを使って
>fb2exr teapot.fb teapot.exr

fujiyama rendererでpythonを使う場合、fujiyama/bin/フォルダにfujiyama.pyをコピーします。
fujiyama.pyファイルを開いて、31と41行目のbin/sceneと二箇所書いてあるところのbin/を削除して保存します。後はset pythonpath=で通してからレンダリングを行います。

>set PYTHONPATH=C:\Python26;C:\Fujiyama-Renderer\bin

例えば、
>python sample.py
でimport fujiyamaが動き、レンダリングします。
シーンファイル内の各モデルや画像のパスを調整してからレンダリングしてください。
Fujiyama Renderer | - | -

Guile RMan #13 サンプルテスト

Aqsis1.6とguile-rmanでのサンプルが動くように調整しました。
sphere_two.jpg
以下、test0.scmを実行します。
Some deprecated features have been used. Set the environment variable GUILE_WARN_DEPRECATED to "detailed" and rerun the program to get more information. Set it to "no" to suppress this message.

export GUILE_WARN_DEPRECATED="detailed"
を.bashrcに書き加えた方が良いです。



#!/usr/bin/guile -s
!#

(use-modules (rman rispec))
(use-modules (rman utilities))

(define (progress percent frame)
(display "Percent: ")
(display percent)
(display " Frame: ")
(display frame)
(newline))

(define (subdiv ptr lod)
(display "Ptr: ")
(display ptr)
(display " Lod: ")
(display lod)
(newline))

(define (free ptr)
(display "Ptr: ")
(display ptr)
(newline))

(define bound #f32(0.0 0.0 0.0 10.0 10.0 10.0))

(define data '(some data))

(RiBegin "test0.rib")
(RiDisplay "sphere_two.tif" "file" "rgb")
(RiFormat 320 240 1)
(RiProjection "perspective" '("fov" 45.0))
(RiTranslate 0 0 6)
(RiProgressHandler progress)
(RiWorldBegin)
(let ((o1 (Object (RiSphere 1 -1 1 360))))
(RiLightSource "ambientlight" '("intensity" 0.2))
(RiLightSource "distantlight" '("intensity" 1.2
"from" #f32(0 0 -6)
"to" #f32(0 0 0)))
(RiColor #f32(1.0 0.0 0.0))
(RiSurface "plastic")
(RiTranslate -2.0 0 0)
(RiObjectInstance o1)
(RiColor #f32(0.0 1.0 0.0))
(RiSurface "plastic")
(RiTranslate 4.0 0 0)
(RiObjectInstance o1)
(RiProcedural data bound subdiv free))
(RiWorldEnd)
(RiEnd)


一歩一歩ですね。ありがとうございます。
RIB出力するようになれば完璧です。
以下は課題?。
configure:11571: checking for RiBegin in -laqsis_core
configure:11606: gcc -o conftest -g -O2 conftest.c -laqsis_core >&5
/usr/lib64/libaqsis_ribparse.so.1: undefined reference to `boost::iostreams::detail::zlib_base::inflate(int)'
collect2: ld returned 1 exit status
RenderMan | - | -

Guile RMan #12 RiReadArchive

Aqsis1.6とguile-rmanでのスクリプトの書き方、ReadArchiveの書式がわかりました。

(RiReadArchive "cone.rib" (list ))

パラメータ部分をlistにしときます。
simple4.jpg
以下は、Nupatchのcone.ribを保存します。


NuPatch 11 4 [-2 -2 -1
0 1 2 3 4 5 6 7 8 9 10 10] 0 8 4 4 [0 0 0 0 2.23607 2.23607 2.23607 2.23607] 0 2.23607 "Pw" [0.783612 -1 -0.783612 1 1.10819 -1 6.51994e-017 1
0.783612 -1 0.783612 1 3.21127e-016 -1 1.10819 1 -0.783612 -1 0.783612 1
-1.10819 -1 2.72688e-016 1 -0.783612 -1 -0.783612 1 -5.95213e-016 -1 -1.10819 1
0.783612 -1 -0.783612 1 1.10819 -1 6.51994e-017 1 0.783612 -1 0.783612 1
0.522408 -0.333333 -0.522408 1 0.738796 -0.333333 6.3877e-017 1 0.522408 -0.333333 0.522408 1
2.14085e-016 -0.333333 0.738796 1 -0.522408 -0.333333 0.522408 1 -0.738796 -0.333333 2.02203e-016 1
-0.522408 -0.333333 -0.522408 1 -3.96809e-016 -0.333333 -0.738796 1 0.522408 -0.333333 -0.522408 1
0.738796 -0.333333 6.3877e-017 1 0.522408 -0.333333 0.522408 1 0.261204 0.333333 -0.261204 1
0.369398 0.333333 6.25547e-017 1 0.261204 0.333333 0.261204 1 1.07042e-016 0.333333 0.369398 1
-0.261204 0.333333 0.261204 1 -0.369398 0.333333 1.31718e-016 1 -0.261204 0.333333 -0.261204 1
-1.98404e-016 0.333333 -0.369398 1 0.261204 0.333333 -0.261204 1 0.369398 0.333333 6.25547e-017 1
0.261204 0.333333 0.261204 1 0 1 6.12323e-017 1 0 1 6.12323e-017 1
0 1 6.12323e-017 1 0 1 6.12323e-017 1 0 1 6.12323e-017 1
0 1 6.12323e-017 1 0 1 6.12323e-017 1 0 1 6.12323e-017 1
0 1 6.12323e-017 1 0 1 6.12323e-017 1 0 1 6.12323e-017 1]

NuPatch 11 4 [-2 -2 -1
0 1 2 3 4 5 6 7 8 9 10 10] 0 8 4 4 [0 0 0 0 2.23607 2.23607 2.23607 2.23607] 0 2.23607 "Pw" [0.783612 -1 -0.783612 1 1.10819 -1 6.51994e-017 1
0.783612 -1 0.783612 1 3.21127e-016 -1 1.10819 1 -0.783612 -1 0.783612 1
-1.10819 -1 2.72688e-016 1 -0.783612 -1 -0.783612 1 -5.95213e-016 -1 -1.10819 1
0.783612 -1 -0.783612 1 1.10819 -1 6.51994e-017 1 0.783612 -1 0.783612 1
0.522408 -0.333333 -0.522408 1 0.738796 -0.333333 6.3877e-017 1 0.522408 -0.333333 0.522408 1
2.14085e-016 -0.333333 0.738796 1 -0.522408 -0.333333 0.522408 1 -0.738796 -0.333333 2.02203e-016 1
-0.522408 -0.333333 -0.522408 1 -3.96809e-016 -0.333333 -0.738796 1 0.522408 -0.333333 -0.522408 1
0.738796 -0.333333 6.3877e-017 1 0.522408 -0.333333 0.522408 1 0.261204 0.333333 -0.261204 1
0.369398 0.333333 6.25547e-017 1 0.261204 0.333333 0.261204 1 1.07042e-016 0.333333 0.369398 1
-0.261204 0.333333 0.261204 1 -0.369398 0.333333 1.31718e-016 1 -0.261204 0.333333 -0.261204 1
-1.98404e-016 0.333333 -0.369398 1 0.261204 0.333333 -0.261204 1 0.369398 0.333333 6.25547e-017 1
0.261204 0.333333 0.261204 1 0 1 6.12323e-017 1 0 1 6.12323e-017 1
0 1 6.12323e-017 1 0 1 6.12323e-017 1 0 1 6.12323e-017 1
0 1 6.12323e-017 1 0 1 6.12323e-017 1 0 1 6.12323e-017 1
0 1 6.12323e-017 1 0 1 6.12323e-017 1 0 1 6.12323e-017 1]

NuPatch 11 4 [-2 -2 -1
0 1 2 3 4 5 6 7 8 9 10 10] 0 8 4 4 [0 0 0 0 1 1 1 1] 0 1 "Pw" [0 -1 0 1 0 -1 0 1
0 -1 0 1 0 -1 0 1 0 -1 0 1
0 -1 0 1 0 -1 0 1 0 -1 0 1
0 -1 0 1 0 -1 0 1 0 -1 0 1
0.261204 -1 -0.261204 1 0.369398 -1 -9.12038e-018 1 0.261204 -1 0.261204 1
1.58307e-016 -1 0.369398 1 -0.261204 -1 0.261204 1 -0.369398 -1 1.62571e-016 1
-0.261204 -1 -0.261204 1 -2.49669e-016 -1 -0.369398 1 0.261204 -1 -0.261204 1
0.369398 -1 -9.12038e-018 1 0.261204 -1 0.261204 1 0.522408 -1 -0.522408 1
0.738796 -1 -1.82408e-017 1 0.522408 -1 0.522408 1 3.16613e-016 -1 0.738796 1
-0.522408 -1 0.522408 1 -0.738796 -1 3.25142e-016 1 -0.522408 -1 -0.522408 1
-4.99337e-016 -1 -0.738796 1 0.522408 -1 -0.522408 1 0.738796 -1 -1.82408e-017 1
0.522408 -1 0.522408 1 0.783612 -1 -0.783612 1 1.10819 -1 -2.73611e-017 1
0.783612 -1 0.783612 1 4.7492e-016 -1 1.10819 1 -0.783612 -1 0.783612 1
-1.10819 -1 4.87713e-016 1 -0.783612 -1 -0.783612 1 -7.49006e-016 -1 -1.10819 1
0.783612 -1 -0.783612 1 1.10819 -1 -2.73611e-017 1 0.783612 -1 0.783612 1]

NuPatch 11 4 [-2 -2 -1
0 1 2 3 4 5 6 7 8 9 10 10] 0 8 4 4 [0 0 0 0 1 1 1 1] 0 1 "Pw" [0 -1 0 1 0 -1 0 1
0 -1 0 1 0 -1 0 1 0 -1 0 1
0 -1 0 1 0 -1 0 1 0 -1 0 1
0 -1 0 1 0 -1 0 1 0 -1 0 1
0.261204 -1 -0.261204 1 0.369398 -1 -9.12038e-018 1 0.261204 -1 0.261204 1
1.58307e-016 -1 0.369398 1 -0.261204 -1 0.261204 1 -0.369398 -1 1.62571e-016 1
-0.261204 -1 -0.261204 1 -2.49669e-016 -1 -0.369398 1 0.261204 -1 -0.261204 1
0.369398 -1 -9.12038e-018 1 0.261204 -1 0.261204 1 0.522408 -1 -0.522408 1
0.738796 -1 -1.82408e-017 1 0.522408 -1 0.522408 1 3.16613e-016 -1 0.738796 1
-0.522408 -1 0.522408 1 -0.738796 -1 3.25142e-016 1 -0.522408 -1 -0.522408 1
-4.99337e-016 -1 -0.738796 1 0.522408 -1 -0.522408 1 0.738796 -1 -1.82408e-017 1
0.522408 -1 0.522408 1 0.783612 -1 -0.783612 1 1.10819 -1 -2.73611e-017 1
0.783612 -1 0.783612 1 4.7492e-016 -1 1.10819 1 -0.783612 -1 0.783612 1
-1.10819 -1 4.87713e-016 1 -0.783612 -1 -0.783612 1 -7.49006e-016 -1 -1.10819 1]



続いて、次のスクリプトをguileで実行します。
simple4.scmで保存します。


#!/usr/bin/guile -s
!#

(use-modules (rman rispec))
(use-modules (rman utilities))

(RiBegin "")
(RiOption "Render" (list "integer multipass" 1))
(RiHider "hidden" (list "depthfilter" "midpoint"))
(RiDisplay "simple4.tif" "file" "rgb")
(RiFormat 512 384 1)
(RiProjection "perspective" '("fov" 30))
(RiTranslate 0 0 3)
(RiRotate -40 1 0 0)
(RiRotate -20 0 1 0)
(RiPixelFilter RiGaussianFilter 2 2)
(RiWorldBegin)
(RiLightSource "ambientlight" (list "intensity" 0.3))
(RiAttributeBegin)
(RiAttribute "autoshadows" (list "string shadowmapname" "autoshadow.shad" "integer res" 1024))
(RiTranslate 5 5 -5)
(RiRotate -45 0.0 1.0 0.0)
(RiRotate 35 1.0 0.0 0.0)
(define light1 (RiLightSource "shadowspot" (list "intensity" 300
"coneangle" 0.5
"string shadowname" "autoshadow.shad"
"float blur" 0.008 )))
(RiAttributeEnd)
(RiIlluminate light1 1 )
(RiAttributeBegin)
(RiTransformBegin)
(RiColor (Color 0.8 0.8 0.8))
(RiSurface "plastic")
(RiPolygon 4 (list "P" #f32(-1 -0.5 -1 -1 -0.5 1 1 -0.5 1 1 -0.5 -1)))
(RiTransformEnd)
(RiTransformBegin)
(RiColor (Color 0.8 0.4 0.2))
(RiSurface "plastic")
;;(RiRotate -90 1 0 0)
(RiScale 0.5 0.5 0.5)
(RiTranslate 0 0.2 0)
(RiReadArchive "cone.rib" (list ))
(RiTransformEnd)
(RiAttributeEnd)
(RiWorldEnd)
(RiEnd)

RenderMan | - | -
1/52 >>