以下、Pov-rayでは未検証ですが、計算してみました。
パースペクティブ・カメラの主なディフォルト設定(省略するとこの設定値が使用されている。)
camera {
perspective
location <0,0,0>
direction <0,0,1>
right <1.33,0,0>
sky <0,1,0>
up <0,1,0>
look_at <0,0,1>
}
画角(angle)
angle、right、directionの関係は次式で表される(right_lengthとdirection_lengthはそれぞれrightとdirectionベクトルの長さ)。
direction_length = 0.5 * right_length / tan(angle / 2)
デフォルトカメラのangleは、
1=0.5*1.33/ tan(angle / 2)
tan(angle / 2)=0.5*1.33
angle / 2=atan(0.5*1.33)
angle=2*atan(0.5*1.33)
で求められるので、以下python cgkitで求めてみました。
>python
Python 2.6.5 (r265:79096, Mar 19 2010, 18:02:59) [MSC v.1500 64 bit (AMD64)
win32 Type "help", "copyright", "credits" or "license" for more information.
>>> from cgkit.all import *
>>> right=vec3(1.33,0,0)
>>> right.length()
1.3300000000000001
>>> direction=vec3(0,0,1)
>>> direction.length()
1.0
>>> import math
コサイン60度を求めてみる。1/2になるかな。
>>> math.cos(math.radians(60))
0.50000000000000011
アークタンジェント:atan(x) を求める。
>>> 2*math.atan(1.33*0.5)
1.1736957392994543
ラジアンを度に変換する。
>>> math.degrees(2*math.atan(1.33*0.5))
67.247812294345678
>>> angle=math.degrees(2*math.atan(1.33*0.5))
>>> angle
67.247812294345678
ということで67度となりましたが、あっているかどうかは
実際POV-RAYで検証しなくてはなりません。
Aqsisのサンプルが参考になったのでPythonインタラクティブモードで確認してみました。
localhost ~]$ python
Python 2.6.6 (r266:84292, Sep 11 2012, 08:28:27)
[GCC 4.4.6 20120305 (Red Hat 4.4.6-4)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> from cgkit.cgtypes import *
>>> from cgkit.ri import *
>>> from math import *
>>> transm = mat4 ( 1 )
>>> transm = transm.lookAt( (10,10,10), (0,0,0) )
>>> transm
[0.707107, -0.408248, -0.57735, 10]
[-0.707107, -0.408248, -0.57735, 10]
[-8.94467e-18, 0.816497, -0.57735, 10]
[0, 0, 0, 1]
>>> transm = transm.inverse()
>>> transm
[0.707107, -0.707107, 0, -0]
[-0.408248, -0.408248, 0.816497, 0]
[-0.57735, -0.57735, -0.57735, 17.3205]
[-0, 0, -0, 1]
>>> RiTransform ( transm )
Transform [0.707106781187 -0.408248290464 -0.57735026919 -0.0 -0.707106781187 -0.408248290464 -0.57735026919 0.0 0.0 0.816496580928 -0.57735026919 -0.0 -0.0 0.0 17.3205080757 1.0]
>>>
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