Orthographic Frustum Problem

This is my first post here, and I have searched through the rest of the forums here for an answer to my problem but I have been unable to find anything.

I am working on a pedestrian simulation of Venice, Italy and for various reasons that necessitated creating a map of Venice made of various segments, which are just 2D egg files. The map looks like this:

The camera used is an orthographic lens and we control zooming with this code:

			newSize = VBase2(self.filmSize.getX()*ZOOM_FACTOR, self.filmSize.getY()*ZOOM_FACTOR)
			base.cam.node().getLens().setFilmSize(newSize)

However, when we zoom in enough, and then zoom out again, we get this effect:

Which is the frustum culling the edges for some reason. When we use

view-frustum-cull 0

we get the correct behavior being able to zoom out without the culling, but for performance reasons we would like to not disable culling.

How can we set the frustum of an orthographic lens to match the film size and why does this occur only when we zoom in past a certain level then zoom out again? The camera itself does not change position at all so it seems odd that the film size somehow decouples from the frustum.

Thank you in advance for any help on this matter.

Hmm, it rather sounds like a bug somewhere; either the bounding volumes are incorrect on your models for some reason, or the frustum is not being computed correctly on your lens.

Is it possible to put together a small code snippet that demonstrates the problem so I can research it?

David

Works for me

from pandac.PandaModules import *
import direct.directbase.DirectStart
import sys

# enables frustum culling on aspect2d
aspect2d.node().setFinal(0)
aspect2d.node().clearBounds()

m=loader.loadModel('misc/lilsmiley')
parent=aspect2d.attachNewNode('')
parent.setScale(.1)

num=21
start=-.5*num
for x in range(num):
    for z in range(num):
        s=m.copyTo(parent)
        s.setPos(start+x,0,start+z)

def zoomIn():
    base.cam2d.node().getLens().setFilmSize(fs*1.1)
    print fs
def zoomOut():
    base.cam2d.node().getLens().setFilmSize(fs*.9)
    print fs

base.accept('escape',sys.exit)
base.accept('wheel_up',zoomIn)
base.accept('wheel_down',zoomOut)
fs = base.cam2d.node().getLens().getFilmSize()
run()

Thank you both for the quick response, I will check out the code provided by ynjh_jo and I will also see if I can create a small demonstration. It may take a bit of time as the code base is rather complicated.