cleanup, copy far planes

This commit is contained in:
David Rose 2005-10-04 00:03:53 +00:00
parent faf39f97ae
commit 3d63d6030a

View File

@ -1608,6 +1608,10 @@ class ShowBase(DirectObject.DirectObject):
if buffer == None:
raise StandardError, "Could not make cube map."
# Set the near and far planes from the default lens.
lens = rig.find('**/+Camera').node().getLens()
lens.setNearFar(base.camLens.getNear(), base.camLens.getFar())
# Now render a frame to fill up the texture.
rig.reparentTo(camera)
base.graphicsEngine.openWindows()
@ -1662,8 +1666,13 @@ class ShowBase(DirectObject.DirectObject):
rig = NodePath(namePrefix)
buffer = toSphere.makeCubeMap(namePrefix, size, 0, rig, cameraMask)
if buffer == None:
base.graphicsEngine.removeWindow(toSphere)
raise StandardError, "Could not make cube map."
# Set the near and far planes from the default lens.
lens = rig.find('**/+Camera').node().getLens()
lens.setNearFar(base.camLens.getNear(), base.camLens.getFar())
# Set up the scene to convert the cube map. It's just a
# simple scene, with only the FisheyeMaker object in it.
dr = toSphere.makeDisplayRegion()
@ -1692,9 +1701,9 @@ class ShowBase(DirectObject.DirectObject):
defaultFilename = defaultFilename,
source = toSphere.getTexture())
#base.graphicsEngine.removeWindow(buffer)
#base.graphicsEngine.removeWindow(toSphere)
#rig.removeNode()
base.graphicsEngine.removeWindow(buffer)
base.graphicsEngine.removeWindow(toSphere)
rig.removeNode()
return saved