最後は,aa-samples", 1,2を削除してからレンダリングするときれいに出ます。
サンプル例 mycylinder.py
------------------------------
#! /usr/bin/env python
from lightflowPM import *
s = scene()
s.lightOn( s.newLight( "point", [ "position", vector3( 5.0, -5.0, 4.0 ), "color", vector3( 300.0, 300.0, 300.0 ) ] ) )
plastic = s.newMaterial( "standard",
[ "ka", vector3( 0, 0, 0.5 ),
"kc", vector3( 1, 0, 0 ),
"kd", 0.5,
"km", 0.3,
"ksg", 0.9999 ] )
plastic2 = s.newMaterial( "standard",[ "kc", vector3( 0, 0.5, 0.75 ) ] )
check_ground=s.newPattern("check",["color",vector3( 0.1, 1.0, 0.1 ),"scale",0.025])
ground=s.newMaterial( "standard",[ "kc", check_ground,"kc",vector3( 1.0, 1.0, 1.0 ),"ka",check_ground ] ) #チェック緑
s.materialBegin( plastic ) #円柱を回転させてみる。
s.transformBegin( transform().rotationAroundX( -3.141592 / 3 ) )
s.transformBegin( transform().rotationAroundY( 3.141592 / 4 ) )
s.addObject( s.newObject( "cylinder", [ "radius", 1.0 ,"height",4.0] ) )
s.transformEnd()
s.transformEnd()
s.materialEnd()
s.materialBegin( plastic2 ) #円すいを加え拡大と移動を行う。
s.transformBegin( transform().translation( vector3(-2.5,0,-1.0)))
s.transformBegin( transform().scaling( vector3(1.5,1.5,1.5)))
s.addObject( s.newObject( "cone", [ "radius",1.5,"height",3.0] ) )
s.transformEnd()
s.transformEnd()
s.materialEnd()
s.materialBegin( ground )
s.addObject( s.newObject( "patch", [ "points",vector3( -50, -50, -1.0 ),vector3( -50, 50, -1.0 ),vector3( 50, -50, -1.0 ),vector3( 50, 50, -1.0 )] ) )
s.materialEnd()
saver = s.newImager( "tga-saver", [ "file", "mycylinder.tga" ] )
s.imagerBegin( saver )
camera = s.newCamera( "pinhole", [ "eye", vector3( 0, -10, 0 ),
"aim", vector3( 0, 0, 0 ),
"aa-samples", 1,2 #レンダリングが速くできる。デフォルトは省略されており,2,4になっている。
] )
s.imagerEnd()
s.render( camera, 300, 300 )
- -
- -