si.SetProperty1('cam1', 'fov', 30)
と設定する。
視点 0 1 8から、
0 1 0を見ている。
以下のpythonサンプルは、fovを変更してみました。
#!/usr/bin/env python
#export PYTHONPATH=$PYTHONPATH:/usr/lib/python2.6/site-packages/:$HOME/Fujiyama-Renderer/bin/
import fujiyama
si = fujiyama.SceneInterface()
#plugins
si.OpenPlugin('ConstantShader')
si.OpenPlugin('PlasticShader')
#Camera
si.NewCamera('cam1', 'PerspectiveCamera')
#si.SetSampleProperty3('cam1', 'translate', 0, 8, 8, 0)
#si.SetSampleProperty3('cam1', 'rotate', -45, 0, 0, 0)
#Calculate python fujicam.py 0 1 8 0 1 0
#si.SetSampleProperty3('cam1', 'rotate',0.00, 180, 0.00,0)
si.SetSampleProperty3('cam1', 'translate', 0, 1, 8,0)
si.SetProperty1('cam1', 'fov', 35)
#Light
si.NewLight('light1', 'SphereLight')
si.SetProperty3('light1', 'translate', -10, 10, 10)
si.SetProperty3('light1', 'scale', .5, .5, .5)
si.SetProperty1('light1', 'intensity', 1)
si.SetProperty1('light1', 'sample_count', 16)
si.NewLight('light2', 'SphereLight')
si.SetProperty3('light2', 'translate', 10, 10, 10)
si.SetProperty3('light2', 'scale', .5, .5, .5)
si.SetProperty1('light2', 'intensity', 1)
si.SetProperty1('light2', 'sample_count', 16)
#Texture
si.NewTexture('tex1', '../mip/pisa.mip')
#Shader
si.NewShader('dome_shader', 'ConstantShader')
si.AssignTexture('dome_shader', 'texture', 'tex1')
si.NewShader('floor_shader', 'PlasticShader')
si.SetProperty3('floor_shader', 'diffuse', .9, .2, .2)
intensity = 0
si.NewShader('sphere_shader', 'PlasticShader')
si.SetProperty3('sphere_shader', 'diffuse', intensity, intensity, intensity)
si.SetProperty1('sphere_shader', 'ior', 40)
#Mesh
si.NewMesh('dome_mesh', '../mesh/dome.mesh')
si.NewMesh('floor_mesh', '../mesh/floor.mesh')
si.NewMesh('sphere_mesh', '../mesh/sphere.mesh')
#ObjectInstance
si.NewObjectInstance('dome1', 'dome_mesh')
si.SetProperty3('dome1', 'rotate', 0, 0, 0)
#si.SetProperty3('dome1', 'scale', -.5, .5, .5)
si.SetProperty3('dome1', 'scale', -2, 2, 2)
si.AssignShader('dome1', 'dome_shader')
si.NewObjectInstance('floor1', 'floor_mesh')
si.SetProperty3('floor1', 'scale', 50, 50, 50)
si.AssignShader('floor1', 'floor_shader')
si.NewObjectInstance('sphere1', 'sphere_mesh')
si.AssignShader('sphere1', 'sphere_shader')
si.SetProperty3('sphere1', 'translate', 0, 1, 0)
#si.SetProperty3('sphere1', 'scale', .5, .5, .5)
#ObjectGroup
si.NewObjectGroup('group1')
si.AddObjectToGroup('group1', 'sphere1')
si.AssignObjectGroup('sphere1', 'shadow_target', 'group1')
si.AssignObjectGroup('floor1', 'shadow_target', 'group1')
#FrameBuffer
si.NewFrameBuffer('fb1', 'rgba')
#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.SetProperty2('ren1', 'pixelsamples', 12, 12)
#Rendering
si.RenderScene('ren1')
#Output
si.SaveFrameBuffer('fb1', '../povsphere04.fb')
#Run commands
si.Run()
#si.Print()
FOV=15
FOV=25
FOV=35(デフォルト)
FOV=45
FOV=67
FOV=90
FOV=120
- -
- -