#!/usr/bin/env python
# -*- coding: utf-8 -*-
#export PYTHONPATH=$PYTHONPATH:/usr/lib/python2.6/site-packages/:$HOME/Fujiyama-Renderer/bin/
from math import *
import fujiyama
si = fujiyama.SceneInterface()
#plugins
si.OpenPlugin('ConstantShader')
si.OpenPlugin('PlasticShader')
si.OpenPlugin('GlassShader')
#Camera
si.NewCamera('cam1', 'PerspectiveCamera')
si.SetProperty3('cam1', 'translate', 0, 2, 6)
si.SetProperty3('cam1', 'rotate', -11.309932474020213, 0, 0)
#Light
si.NewLight('light1', 'PointLight')
si.SetProperty3('light1', 'position', 10, 12, 10)
#Shader
si.NewShader('floor_shader', 'PlasticShader')
si.SetProperty3('floor_shader', 'diffuse', .2, .25, .3)
si.SetProperty1('floor_shader', 'ior', 2)
si.NewShader('cube_shader', 'PlasticShader')
si.SetProperty3('cube_shader', 'diffuse', .9, .2, .2)
#si.NewShader('cube_shader3', 'PlasticShader')
#si.SetProperty3('cube_shader3', 'diffuse', .1, .2, .8)
#si.NewShader('cube_shader2', 'PlasticShader')
#si.SetProperty3('cube_shader2', 'diffuse', .1, .95, .1)
si.NewShader('dome_shader', 'ConstantShader')
si.SetProperty3('dome_shader', 'diffuse', .8, .8, .8)
#Mesh
si.NewMesh('dome_mesh', '../mesh/dome.mesh')
si.NewMesh('floor_mesh', '../mesh/floor.mesh')
si.NewMesh('cube_mesh', '../mesh/cube.mesh')
#ObjectInstance
N1=16
J=1
while J<=N1:
si.NewShader('cube_shader'+str(J), 'PlasticShader')
si.SetProperty3('cube_shader'+str(J), 'diffuse', 0.5*(1+sin(2*pi/N1*J)),0.5, 0.5*(1+cos(2*pi/N1*J)))
si.NewObjectInstance('cube'+str(J), 'cube_mesh')
si.AssignShader('cube'+str(J), 'cube_shader'+str(J))
si.SetProperty3('cube'+str(J), 'translate', 1.7*sin(2*pi/N1*J),.4, 1.7*cos(2*pi/N1*J))
si.SetProperty3('cube'+str(J), 'rotate', 0,360/N1*J, 0)
si.SetProperty3('cube'+str(J), 'scale', .5,.5, .5)
J+=1
si.NewObjectInstance('floor1', 'floor_mesh')
si.AssignShader('floor1', 'floor_shader')
si.NewObjectInstance('dome1', 'dome_mesh')
si.AssignShader('dome1', 'dome_shader')
#FrameBuffer
si.NewFrameBuffer('fb1', 'rgba')
#Properties
si.ShowPropertyList('Renderer')
#Renderer
si.NewRenderer('ren1')
si.AssignCamera('ren1', 'cam1')
si.AssignFrameBuffer('ren1', 'fb1')
si.SetProperty2('ren1', 'resolution', 640, 480)
#si.SetProperty2('ren1', 'resolution', 160, 120)
si.SetProperty1('ren1', 'raymarch_step', .01)
si.SetProperty1('ren1', 'raymarch_shadow_step', .02)
si.SetProperty1('ren1', 'raymarch_reflect_step', .02)
#Rendering
si.RenderScene('ren1')
#Output
si.SaveFrameBuffer('fb1', '../cube04.fb')
#Run commands
si.Run()
#si.Print()
Thank you for your support.
ありがとうございます。
- -
- -