本文整理汇总了Python中Camera.dof方法的典型用法代码示例。如果您正苦于以下问题:Python Camera.dof方法的具体用法?Python Camera.dof怎么用?Python Camera.dof使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Camera
的用法示例。
在下文中一共展示了Camera.dof方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1:
# 需要导入模块: import Camera [as 别名]
# 或者: from Camera import dof [as 别名]
# note the function is overloaded so we can concatinate output
ri.ArchiveRecord(ri.COMMENT, 'File ' +filename)
ri.ArchiveRecord(ri.COMMENT, "Created by " + getpass.getuser())
ri.ArchiveRecord(ri.COMMENT, "Creation Date: " +time.ctime(time.time()))
ri.Declare("Light1" ,"string")
ri.Declare("Light2" ,"string")
ri.Declare("Light3" ,"string")
ri.Declare("Ambient" ,"string")
# now we add the display element using the usual elements
# FILENAME DISPLAY Type Output format
ri.Display("dof.%03d.exr" %(frame), "file", "rgba")
# Specify PAL resolution 1:1 pixel Aspect ratio
cam.Format(ri)
cam.dof(ri)
depth +=0.5
cam.focaldistance=depth
# now we start our world
ri.WorldBegin()
ri.LightSource ("ambientlight",{ri.HANDLEID: "Ambient","intensity" :[0.5]})
ri.LightSource( "distantlight", {ri.HANDLEID:"Light1", "point to":[1,-0.03,0], "float intensity": [1]})
ri.LightSource( "distantlight", {ri.HANDLEID:"Light2", "point to":[-1,-0.03,0], "float intensity": [1]})
ri.LightSource( "distantlight", {ri.HANDLEID:"Light3", "point to":[0,-0.5,-1], "float intensity": [0.2]})
ri.Illuminate("Light1",1)
ri.Illuminate("Light2",1)
ri.Illuminate("Light3",1)
cam.Place(ri)