s.transformBegin( transform().rotationAroundX( pi*30.0/180 )
Pythonで除算する時は、小数点をつけておかないと正しく計算しないから注意する必要がある。
#! /usr/bin/env python
from lightflowPM import *
from math import *
s = scene()
s.lightOn( s.newLight( "point", [ "position", vector3( 5.0, -5.0, 3.0 ), "color", vector3( 300.0, 300.0, 300.0 ) ] ) )
s.lightOn( s.newLight( "point", [ "position", vector3( -5.0, -5.0, 3.0 ), "color", vector3( 300.0, 300.0, 300.0 ) ] ) )
s.lightOn( s.newLight( "point", [ "position", vector3( 5.0, -5.0, -3.0 ), "color", vector3( 300.0, 300.0, 300.0 ) ] ) )
plastic = s.newMaterial( "standard", [ "kc", vector3( 0.096, 0.252, 0.504 ), "kd", 0.5, "km", 0.1 ] )
s.materialBegin( plastic )
s.transformBegin( transform().rotationAroundX( pi*30.0/180 ) )
s.addObject( s.newObject( "cylinder", [ "radius", 1.0 ,"height",2.4] ) )
s.transformEnd()
s.materialEnd()
saver = s.newImager( "tga-saver", [ "file", "bool01.tga" ] )
s.imagerBegin( saver )
camera = s.newCamera( "pinhole", [ "eye", vector3( 0, -4, 3 ),
"aim", vector3( 0, 1, 0 ),
"aa-samples", 2,5
] )
s.imagerEnd()
s.render( camera, 300, 300 )
- -
- -