<< はじめてのFujiyama Renderer その27 戻る はじめてのFujiyama Renderer その28 >>

Python CgkitでのTransform

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]
>>>
  • -
  • -

<< はじめてのFujiyama Renderer その27 戻る はじめてのFujiyama Renderer その28 >>