當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。