Commit f7b6f7ee authored by sumpfralle's avatar sumpfralle

flat 2D models did not fit completely into the "top" view


git-svn-id: https://pycam.svn.sourceforge.net/svnroot/pycam/trunk@958 bbaffbd6-741e-11dd-a85d-61de82d9cad9
parent d9296fbd
...@@ -121,9 +121,9 @@ class Camera: ...@@ -121,9 +121,9 @@ class Camera:
max_dim = max(max(dimx, dimy), dimz) max_dim = max(max(dimx, dimy), dimz)
distv = Point(v["distance"][0], v["distance"][1], distv = Point(v["distance"][0], v["distance"][1],
v["distance"][2]).normalized() v["distance"][2]).normalized()
# The multiplier "1.3" is based on experiments. 1.414 (sqrt(2)) should # The multiplier "1.25" is based on experiments. 1.414 (sqrt(2)) should
# be roughly sufficient for showing the diagonal of any model. # be roughly sufficient for showing the diagonal of any model.
distv = distv.mul((max_dim * 1.2) / number(math.sin(v["fovy"] / 2))) distv = distv.mul((max_dim * 1.25) / number(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 # Adjust the "far" distance for the camera to make sure, that huge
# models (e.g. x=1000) are still visible. # models (e.g. x=1000) are still visible.
......
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