本文整理汇总了Python中PyUnseen.createView方法的典型用法代码示例。如果您正苦于以下问题:Python PyUnseen.createView方法的具体用法?Python PyUnseen.createView怎么用?Python PyUnseen.createView使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PyUnseen
的用法示例。
在下文中一共展示了PyUnseen.createView方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: createView
# 需要导入模块: import PyUnseen [as 别名]
# 或者: from PyUnseen import createView [as 别名]
def createView(self, world):
"""Create a view object and return the handle to it.
Width and height ignored by PyUnseen
"""
handle = PyUnseen.createView(world)
self.cache[handle] = "view"
return handle
示例2: run
# 需要导入模块: import PyUnseen [as 别名]
# 或者: from PyUnseen import createView [as 别名]
def run():
done = 1
frame = 0
t = time.time()
import testopt
opts = testopt.parseCommandLine(800, 600, "dx")
pyui.init(*opts)
# w = pyui.widgets.ViewWindow(10, 10, 400, 300)
# w.pack()
terrainDetails = CreateTestTerrainDetails()
terrain = PyUnseen.createTerrainRegion(terrainDetails) # will take dictionary of stuff
rootWorld = PyUnseen.getRootWorld()
PyUnseen.addToWorld(rootWorld, terrain) # just like any other object
cameraPos = (-10, 6, -10)
cameraDir = (45, -45, 0)
view1 = PyUnseen.createView(rootWorld) # will also take zMin, zMax?
PyUnseen.setCameraParameters(view1, cameraPos, cameraDir)
rootView = PyUnseen.getRootView()
PyUnseen.setCameraParameters(rootView, cameraPos, cameraDir)
while done:
pyui.draw()
done = pyui.update()
print "done"
pyui.quit()