michaelrepucci
08-28-2008, 02:55 PM
I'm not understanding the difference (if any) between using the MainWindow.frustum call and the MainWindow.clip and MainWindow.fov calls. I would have expected them to give the same result in the following code, but they don't. Does anyone know why?
clipPlanes = (0.1,10)
fov = 2*degrees(atan(screenHeight/(2*screenDistance)))
aspectRatio = viz.MainWindow.getSize(viz.WINDOW_PIXELS)[0]/viz.MainWindow.getSize(viz.WINDOW_PIXELS)[1]
topBottom = tan(radians(fov/2))*clipPlanes[0]
viz.MainWindow.clip(clipPlanes)
viz.MainWindow.fov(fov,aspectRatio)
viz.MainWindow.frustum(-aspectRatio*topBottom,aspectRatio*topBottom,-topBottom,topBottom,clipPlanes[0],clipPlanes[1])
clipPlanes = (0.1,10)
fov = 2*degrees(atan(screenHeight/(2*screenDistance)))
aspectRatio = viz.MainWindow.getSize(viz.WINDOW_PIXELS)[0]/viz.MainWindow.getSize(viz.WINDOW_PIXELS)[1]
topBottom = tan(radians(fov/2))*clipPlanes[0]
viz.MainWindow.clip(clipPlanes)
viz.MainWindow.fov(fov,aspectRatio)
viz.MainWindow.frustum(-aspectRatio*topBottom,aspectRatio*topBottom,-topBottom,topBottom,clipPlanes[0],clipPlanes[1])