Commit 161aa523 authored by sumpfralle's avatar sumpfralle

fix visibility issue with huge models due to a limited "zfar" value for OpenGL camera settings


git-svn-id: https://pycam.svn.sourceforge.net/svnroot/pycam/trunk@281 bbaffbd6-741e-11dd-a85d-61de82d9cad9
parent 5a126a16
...@@ -71,6 +71,8 @@ class Camera: ...@@ -71,6 +71,8 @@ class Camera:
# the multiplier "2.0" is based on: sqrt(2) + margin -- the squre root makes sure, that the the diagonal fits # the multiplier "2.0" is based on: sqrt(2) + margin -- the squre root makes sure, that the the diagonal fits
distv = distv.mul((max_dim * 2.0) / math.sin(v["fovy"]/2)) distv = distv.mul((max_dim * 2.0) / math.sin(v["fovy"]/2))
self.view["distance"] = (distv.x, distv.y, distv.z) self.view["distance"] = (distv.x, distv.y, distv.z)
# adjust the "far" distance for the camera to make sure, that huge models (e.g. x=1000) are still visible
self.view["zfar"] = 100 * max_dim
def scale_distance(self, scale): def scale_distance(self, scale):
if scale != 0: if scale != 0:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment