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


Python Program.getScreen方法代码示例

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


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

示例1: Program

# 需要导入模块: from program import Program [as 别名]
# 或者: from program.Program import getScreen [as 别名]
from canvas import Screen
from world import World
from forms import Point, Line, Cube, Polygon, House, PointyRoof, TriangleRoof, SlopedRoofXpositive, SlopedRoofXnegative, RandomRoof, Street
from program import Program



# Setting up a 3D scene:
# (1) Initialize a Program:
#     This is the frame which holds the program
# (2) Setup a camera:
#     This camera references a canvas that is drawn to the screen by the program
# (3) Initialize a world:
#     Setup the world and fill it with shapes which have to be displayable
# (4) Look at the world through the camera.
# (5) Run the program.

program = Program()

cam = Camera(program.getScreen())

world = World()

world.addShapes([
    Street(Point(-4, 0, -10), 1.5, 1, 10)
])

cam.lookAt(world)

program.run()
开发者ID:RoelofRuis,项目名称:PGG,代码行数:32,代码来源:run.py


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