本文整理汇总了Python中scene.Scene.setUpCamera方法的典型用法代码示例。如果您正苦于以下问题:Python Scene.setUpCamera方法的具体用法?Python Scene.setUpCamera怎么用?Python Scene.setUpCamera使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类scene.Scene
的用法示例。
在下文中一共展示了Scene.setUpCamera方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: Vector
# 需要导入模块: from scene import Scene [as 别名]
# 或者: from scene.Scene import setUpCamera [as 别名]
blue = Vector(0, 0, 1)
yellow = Vector(1, 1, 0)
grey = Vector(.5, .5, .5)
# Materials
redSurface = Material(red)
greenSurface = Material(green)
blueSurface = Material(blue)
greySurface = Material(grey)
yellowSurface = Material(yellow)
checkerboard = CheckerboardMaterial()
# Add objects to scene
scene.addObject(Sphere(Point(2.5, 3, -10), RADIUS, redSurface))
scene.addObject(Sphere(Point(-2.5, 3, -10), RADIUS, greenSurface))
scene.addObject(Sphere(Point(0, 7, -10), RADIUS, blueSurface))
scene.addObject(Plane(Point(0, 0, 0), Vector(0, 1, 0), checkerboard))# greySurface))
scene.addObject(Triangle(Point(2.5, 3, -10), Point(-2.5, 3, -10), Point(0, 7, -10), yellowSurface))
scene.addLight(Light(Point(30, 30, 10)))
scene.setUpCamera(Point(0,2,10), Vector(0,1,0), Point(0,3,0), FIELDOFVIEW)
# and render
scene.render(image, level=recursionLevel)
print 'Rendering Time: %d seconds' % (time.time() - beginTime)
image.show()
image.save('out_image.png', 'PNG')