本文整理汇总了Python中panda3d.core.OrthographicLens.setFov方法的典型用法代码示例。如果您正苦于以下问题:Python OrthographicLens.setFov方法的具体用法?Python OrthographicLens.setFov怎么用?Python OrthographicLens.setFov使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类panda3d.core.OrthographicLens
的用法示例。
在下文中一共展示了OrthographicLens.setFov方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: ShadowSource
# 需要导入模块: from panda3d.core import OrthographicLens [as 别名]
# 或者: from panda3d.core.OrthographicLens import setFov [as 别名]
#.........这里部分代码省略.........
self.onPropertyChanged()
def getAtlasPos(self):
""" Returns the assigned atlas pos, if present. Coordinates are float
from 0 .. 1 """
return self.atlasPos
def hasAtlasPos(self):
""" Returns Whether this ShadowSource has already a position in the
shadow atlas, or is currently unassigned """
return self.doesHaveAtlasPos
def removeFromAtlas(self):
""" Deletes the atlas coordinates, this gets called by the atlas after the
Source got removed from the atlas """
self.doesHaveAtlasPos = False
self.atlasPos = Vec2(0)
def setResolution(self, resolution):
""" Sets the resolution in pixels of this shadow source. Has to be
a multiple of the tileSize specified in LightManager """
assert(resolution > 1 and resolution <= 8192)
self.resolution = resolution
def getResolution(self):
""" Returns the resolution of the shadow source in pixels """
return self.resolution
def setupPerspectiveLens(self, near=0.1, far=100.0, fov=(90, 90)):
""" Setups a PerspectiveLens with a given near plane, far plane
and FoV. The FoV is a tuple in the format (Horizontal FoV, Vertical FoV) """
self.lens = PerspectiveLens()
self.lens.setNearFar(near, far)
self.lens.setFov(fov[0], fov[1])
self.camera.setLens(self.lens)
self.nearPlane = near
self.farPlane = far
self.rebuildMatrixCache()
def setLens(self, lens):
""" Setups the ShadowSource to use an external lens """
self.lens = lens
self.camera.setLens(self.lens)
self.nearPlane = lens.getNear()
self.farPlane = lens.getFar()
self.nearPlane = 0.5
self.farPlane = 50.0
self.rebuildMatrixCache()
def setupOrtographicLens(self, near=0.1, far=100.0, filmSize=(512, 512)):
""" Setups a OrtographicLens with a given near plane, far plane
and film size. The film size is a tuple in the format (filmWidth, filmHeight)
in world space. """
self.lens = OrthographicLens()
self.lens.setNearFar(near, far)
self.lens.setFilmSize(*filmSize)
self.camera.setLens(self.lens)
self.nearPlane = near
self.farPlane = far
self.rebuildMatrixCache()
def rebuildMatrixCache(self):
""" Internal method to precompute a part of the MVP to improve performance"""
self.converterYUR = self.lens.getProjectionMat()
def setPos(self, pos):