当前位置: 首页>>代码示例>>Python>>正文


Python Scene.ambient方法代码示例

本文整理汇总了Python中scene.Scene.ambient方法的典型用法代码示例。如果您正苦于以下问题:Python Scene.ambient方法的具体用法?Python Scene.ambient怎么用?Python Scene.ambient使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在scene.Scene的用法示例。


在下文中一共展示了Scene.ambient方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: Material

# 需要导入模块: from scene import Scene [as 别名]
# 或者: from scene.Scene import ambient [as 别名]
SHINY_SPHERE = Material(Colour(0.2, 0.3, 0.7), Colour(0.8,0.8,0.8), 200, .3)
MATT_CUBE = Material(Colour(0.7,0.7, 0.7), Colour(0.9,0.9,0.9), 300, .5)
CHECK_FLOOR = Material(None, None, None, None, Texture_Check(6, Colour(.1,.1,.1), Colour(0.7,0.7,0.7)))

scene = Scene([
    Intersection([ # Cube
	Plane(Point3(0.5,0.0,0.5), Vector3(0,-1,0), MATT_CUBE),
	Plane(Point3(0.5,0.1,0.5), Vector3(0, 1,0), MATT_CUBE),
	Plane(Point3(0.2,0.0,0.5), Vector3(-1,.3,0), MATT_CUBE),
	Plane(Point3(0.8,0.0,0.5), Vector3( 1,.3,0), MATT_CUBE),
	Plane(Point3(0.5,0.0,0.8), Vector3(0,.3, 1), MATT_CUBE),
	Plane(Point3(0.5,0.0,0.2), Vector3(0,.3,-1), MATT_CUBE)]),
    Sphere(Point3(0.5,0.3,0.5), 0.2, SHINY_SPHERE),
    Plane(Point3(0,0,0), Vector3(0,1,0), CHECK_FLOOR),
])

scene.lights = [
    SpotLight(scene, Point3( 1, 1,  1), Point3(0.5,0.5,0.5), 20, Colour(.8,0,0)),
    SpotLight(scene, Point3( 1.2, 1, -1), Point3(0.5,0.5,0.5), 25, Colour(0,1,0)),
    SpotLight(scene, Point3(-1, 1,  1.2), Point3(0.5,0.5,0.5), 25, Colour(0,0,1)),
]
scene.background = Colour(0, 0, 0)
scene.ambient = Colour(0.3, 0.3, 0.3) 


camera = Camera(scene, Point3(1.5, 0.9, 1.6),WIN_SIZE)
camera.lookAt(Point3(0.5,0.1,0.5))
camera.setFoV(30)


开发者ID:duststorm,项目名称:Python-Ray-tracer,代码行数:30,代码来源:basic.py

示例2: Sphere

# 需要导入模块: from scene import Scene [as 别名]
# 或者: from scene.Scene import ambient [as 别名]
		 Sphere(Point3(0.1,0.175,0.8), 0.165, SHINY_BLUE)]),
	       Sphere(Point3(0.75,0.17,.8), 0.17, SHINY_RED),
               Plane(Point3(0,0,0), Vector3(0,1,0), CHECK_FLOOR),
	       Difference([
	       Intersection([ # Cube
		  Plane(Point3(0.2,0.0,0.5), Vector3(0,-1,0), MATT_GREEN),
		  Plane(Point3(0.1,0.08,0.8), Vector3(0, 1,0), MATT_GREEN),
		  Plane(Point3(0.3,0.1,0.5), Vector3(-1,0,0), MATT_GREEN),
		  Plane(Point3(0.5,0.1,0.5), Vector3( 1,0,0), MATT_GREEN),
		  Plane(Point3(0.5,0.1,1.3), Vector3(0,0, 1), MATT_GREEN),
		  Plane(Point3(0.5,0.1,  1), Vector3(0,0,-1), MATT_GREEN)]),
	       Sphere(Point3(0.4, .1, 1.3), 0.1, SHINY_RED)]),
	       ])

scene.lights = [
	  #Light(scene, unit(Vector3(2,5,3)), Colour(0.6, 0.6, 0.6)),
	  #Light(scene, unit(Vector3(-4,3,0)), Colour(0.7, 0.7, 0.7)),
	  PointLight(scene, Point3(.5, 1.1, 1.2), Colour(0.9, 0.9, 0.9)),
	  SpotLight(scene, Point3(.5,.5,1.5), Point3(0.4,0.0,1.15), 25, Colour(0.9, 0.9, 0.9))
	  ]
scene.background = Colour(0, 0, 0)
scene.ambient = Colour(0.1, 0.1, 0.1) 


camera = Camera(scene, Point3(0, 0.2, 2),WIN_SIZE)
#camera.lookAt(Point3(0.5,0.2,0.3))
camera.lookAt(Point3(0.5,0.3, 0.5))
#camera.setFoV(90)


开发者ID:duststorm,项目名称:Python-Ray-tracer,代码行数:30,代码来源:balls2.py

示例3: Sphere

# 需要导入模块: from scene import Scene [as 别名]
# 或者: from scene.Scene import ambient [as 别名]
	       Sphere(Point3(0.35,0.6,0.5), 0.25, SHINY_BLUE),
	       #Difference([
	       Intersection([ # Cube
		  #Plane(Point3(0.2,0.0,0.5), Vector3(0,-1,0), CHECK_FLOOR),
		  Plane(Point3(0.1,0.175,0.8), Vector3(0.5, 1,0.1), SHINY_BLUE),
		  #Plane(Point3(0.1,0.1,0.5), Vector3(-1,0,0), CHECK_FLOOR),
		  #Plane(Point3(0.4,0.1,0.5), Vector3( 1,0,0), CHECK_FLOOR),
		  #Plane(Point3(0.5,0.1,0.8), Vector3(0,0, 1), CHECK_FLOOR),
		  #Plane(Point3(0.5,0.1,0.5), Vector3(0,0,-1), CHECK_FLOOR),
		  Sphere(Point3(0.1,0.175,0.8), 0.175, SHINY_BLUE),
			  ]),
		 #Sphere(Point3(0.1,0.175,0.8), 0.165, SHINY_BLUE)]),
	       #Sphere(Point3(0.75,0.15,.2), 0.15, SHINY_RED),
               Plane(Point3(0,0,0), Vector3(0,1,0), CHECK_FLOOR)
	       ])

scene.lights = [
	  #Light(scene, unit(Vector3(2,5,3)), Colour(0.6, 0.6, 0.6)),
	  #Light(scene, unit(Vector3(-4,3,0)), Colour(0.7, 0.7, 0.7)),
	  PointLight(scene, Point3(.5, 1.1, 1.2), Colour(0.9, 0.9, 0.9)),
	  ]
scene.background = Colour(0, 0, 0)
scene.ambient = Colour(0.4, 0.4, 0.4) 


camera = Camera(scene, Point3(0.5, 0.2, 1.6),WIN_SIZE)
camera.lookAt(Point3(0.5,0.2,0.3))
#camera.lookAt(Point3(0.1,0.1, 0.9))


开发者ID:duststorm,项目名称:Python-Ray-tracer,代码行数:30,代码来源:balls.py


注:本文中的scene.Scene.ambient方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。