from lightflowPM import * s = scene() s.newInterface( "default",["trace-depth", 6,"radiosity-depth", 1, 3, "radiosity-samples", 100,"radiosity-threshold", 0.05,"radiosity-reuse-distance", 4.0, 1.0, 0.1,"photon-count", 300000,"photon-clustering-count", 2000, 100 ]) LFMAT1 = s.newMaterial( 'standard', [ 'kc', vector3(0.800000011921, 0.800000011921, 0.800000011921), 'kd', 0.620504, 'ksg', 0.379496, 'km', 0.335213 ,'radiosity', 1, 'caustics', 4, 4 ] ) bluecrystal = s.newMaterial( "generic", [ "fresnel", 1, "IOR", 1.57, "kdr", vector3( 0, 0, 0 ), "kdt", vector3( 0, 0, 0 ), "ksr", vector3( 0.6, 1.0, 0.8 ), "kst", vector3( 0.6, 0.8, 1.0 ), "kr", vector3( 0.6, 1.0, 0.8 ), "kt", vector3( 0.6, 0.8, 1.0 ), "km", 0.03, "shinyness", 1.0, "transmission", 0, "radiosity", 0, "caustics", 4, 4 ] ) plastic = s.newMaterial( "standard", [ "kc", vector3( 1, 1, 1 ), "kr", vector3( 0.2, 0.2, 0.2 ), "kd", 0.5, "km", 0.1 ] ) metal = s.newMaterial( "physical", [ "fresnel", 1, "IOR", 9.0, "kr", vector3( 1.0, 0.9, 0.8 ), "kd", 0.1, "km", 0.1, "shinyness", 1.0, "radiosity", 0, "caustics", 4, 4 ] ) LFMAT2 = s.newMaterial( 'standard', [ 'kc', vector3(0.800000011921, 0.800000011921, 0.800000011921), 'kd', 0.620504, 'ksg', 0.379496, 'km', 0.335213 ,'radiosity', 1, 'caustics', 4, 4 ] ) LFMAT3 = s.newMaterial( 'standard', [ 'kc', vector3(0.800000011921, 0.800000011921, 0.800000011921), 'kd', 0.620504, 'ksg', 0.379496, 'km', 0.335213 ,'radiosity', 1, 'caustics', 4, 4 ] ) LFMAT4 = s.newMaterial( 'standard', [ 'kc', vector3(0.679699242115, 0.664661645889, 0.800000011921), 'kd', 0.750000, 'ksg', 0.250000, 'km', 0.335213 ,'radiosity', 1, 'caustics', 4, 4 ] ) LFMAT8 = s.newMaterial( 'standard', [ 'ka', vector3(0.9, 0.9, 0.85 ), 'kc', vector3(0.0, 0.0, 0.0), 'kd', 0.0, 'shadowing', 0.0 ] ) s.materialBegin(bluecrystal) s.transformBegin(transform().translation( vector3(-0.097738482058,0.0492451526225,1.10337281227 ) )) s.transformBegin(transform().rotationAroundZ( 0.523599267006 ) ) s.transformBegin(transform().rotationAroundY( 1.49011597728e-007 ) ) s.transformBegin(transform().rotationAroundX( 1.04719829559 ) ) s.transformBegin(transform().scaling( vector3( 0.590798795223,0.590798854828,0.590798854828) )) s.addObject( s.newObject( 'mesh', [ 'file', 'crystal_AS45.mesh', 0] ) ) s.transformEnd() s.transformEnd() s.transformEnd() s.transformEnd() s.transformEnd() s.materialEnd() s.materialBegin(metal) s.transformBegin(transform().translation( vector3(-0.0975763276219,0.0404610931873,0.743514657021 ) )) s.transformBegin(transform().rotationAroundZ( 0.0 ) ) s.transformBegin(transform().rotationAroundY( 0.0 ) ) s.transformBegin(transform().rotationAroundX( 1.57079708576 ) ) s.transformBegin(transform().scaling( vector3( 0.752704977989,0.752704977989,0.752704977989) )) s.addObject( s.newObject( 'mesh', [ 'file', 'Cube_AS45.mesh', 0] ) ) s.transformEnd() s.transformEnd() s.transformEnd() s.transformEnd() s.transformEnd() s.materialEnd() s.materialBegin(plastic) s.transformBegin(transform().translation( vector3(0.0,-8.31025379804e-015,0.324195295572 ) )) s.transformBegin(transform().rotationAroundZ( 0.0 ) ) s.transformBegin(transform().rotationAroundY( 0.0 ) ) s.transformBegin(transform().rotationAroundX( 1.57079684734 ) ) s.transformBegin(transform().scaling( vector3( 2.25065660477,2.25065660477,2.25065660477) )) s.addObject( s.newObject( 'mesh', [ 'file', 'Plane.mesh', 0] ) ) s.transformEnd() s.transformEnd() s.transformEnd() s.transformEnd() s.transformEnd() s.materialEnd() s.materialBegin(LFMAT8) s.transformBegin(transform().translation( vector3(-0.142139837146,0.130809426308,1.10566806793 ) )) s.transformBegin(transform().rotationAroundZ( 1.5707962513 ) ) s.transformBegin(transform().rotationAroundY( 2.98023223877e-008 ) ) s.transformBegin(transform().rotationAroundX( 1.5707962513 ) ) s.transformBegin(transform().scaling( vector3( 14.0259332657,14.0259332657,14.0259332657) )) s.addObject( s.newObject( 'mesh', [ 'file', 'Sphere_AS45p.mesh', 0] ) ) s.transformEnd() s.transformEnd() s.transformEnd() s.transformEnd() s.transformEnd() s.materialEnd() saver = s.newImager("tga-saver", [ "file", "boxes.tga", "alpha",0, "depth", 0]) s.imagerBegin( saver ) camera = s.newCamera( "pinhole", [ "eye", vector3( 3.26385641098,-6.86164808273,3.86412191391 ), "aim", vector3(2.85237184244,-6.02299432984,3.50727414159), "fov",0.378393726493] ) s.imagerEnd() s.radiosity() s.render(camera,540,512)