本文整理汇总了Python中engine.Engine.project方法的典型用法代码示例。如果您正苦于以下问题:Python Engine.project方法的具体用法?Python Engine.project怎么用?Python Engine.project使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类engine.Engine
的用法示例。
在下文中一共展示了Engine.project方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: Renderer
# 需要导入模块: from engine import Engine [as 别名]
# 或者: from engine.Engine import project [as 别名]
R = Renderer()
F = Flocker()
#Gen 3D data (cube)
points = []
spacing = 20
for x in range(-8, 8, 2):
for y in range(-8, 8, 2):
for z in range(1):
points.append(((x+1)*spacing, (y+1)*spacing+1, z))
points = np.array(points)
#Project it on 2D plane and move origin to center of screen
projected = E.project(points)
projected = E.translate(projected, 320)
R.points = points#projected
D = Distortion(np.array([[20,20,5]]), 30)
#Render and handle events
R.start()
F.start(points)
endRun = False
space = points
while not endRun:
R.points = F.space#E.translate(E.project(F.space), 320)
for event in pygame.event.get():
if event.type == QUIT: