本文整理汇总了Python中Camera.Camera.up方法的典型用法代码示例。如果您正苦于以下问题:Python Camera.up方法的具体用法?Python Camera.up怎么用?Python Camera.up使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Camera.Camera
的用法示例。
在下文中一共展示了Camera.up方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: getCamera
# 需要导入模块: from Camera import Camera [as 别名]
# 或者: from Camera.Camera import up [as 别名]
return self
def getCamera(self):
return self._camera
camera = property(getCamera, setCamera, None, "The camera")
if __name__ == "__main__":
from Sphere import ColoredSphere
from Plane import ColoredPlane
from Triangle import ColoredTriangle
from HomVec3 import HomVec3
from Light import PointLight
c = Camera()
c.position = HomVec3(0,2,10,True)
# c.position = HomVec3(30,30,10,True)
c.up = HomVec3(0,1,0)
c.target = HomVec3(0,3,0,True)
c.angle = 45
r = Raytracer(400, 400)
r.camera = c
r.addObject(ColoredPlane(HomVec3(0,0,0,True), HomVec3(0,1,0), RGB(0.5,0.5,0.5)))
r.addObject(ColoredSphere(HomVec3(2.5,3,-10,True), 2, RGB(0.5,0,0)))
r.addObject(ColoredSphere(HomVec3(-2.5,3,-10,True), 2, RGB(0,0.5,0)))
r.addObject(ColoredSphere(HomVec3(0,7,-10,True), 2, RGB(0,0,0.5)))
r.addObject(ColoredTriangle(HomVec3(2.5,3,-10,True),HomVec3(-2.5,3,-10,True), HomVec3(0,7,-10,True), RGB(0.95,.7,0.07)))
r.addLight(PointLight(HomVec3(30,30,10,True)))
#r.addObject(ColoredSphere(HomVec3(0,1,0,True), 1, RGB(0,0.5,0)))
#r.addObject(ColoredSphere(HomVec3(2.5,1,0,True), 1.5, RGB(0,0,0.5)))
#r.addLight(PointLight(HomVec3(10,0,0,True)))