本文整理汇总了Python中World.renderScene方法的典型用法代码示例。如果您正苦于以下问题:Python World.renderScene方法的具体用法?Python World.renderScene怎么用?Python World.renderScene使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类World
的用法示例。
在下文中一共展示了World.renderScene方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: Regular
# 需要导入模块: import World [as 别名]
# 或者: from World import renderScene [as 别名]
sampler = Regular(25, 83)
texture = ImageTexture(texels, sphere_map, image.size[0], image.size[1])
t_mat = Matte(0.75, 0.75, texture, sampler)
t_s = Sphere(Point(0, 0, -5), 8.0, t_mat)
world.addObject(t_s)
#area Light
intensity = 10.0
emissive = Emissive(intensity, white)
p0 = Point(-5, 20, -12)
a = Vector(10.0, 0, 0)
b = Vector(0, 10.0, 0)
sampler = Regular(25, 83)
rectangle = Rectangle(p0, a, b, emissive, sampler)
world.addObject(rectangle)
area_light = AreaLight(rectangle)
world.addLight(area_light)
"""
#Bunny
vertices, faces = world.OBJLoad("bunny.obj")
for f in faces:
t = Triangle(vertices[f[0]-1], vertices[f[1]-1], vertices[f[2]-1], phong)
world.addObject(t)
"""
start_time = time.time()
world.renderScene()
print("Time elapsed: {0}".format(time.time() - start_time))
print("with {0} rays shot".format(world.rays))