diff options
author | Marius Kintel <marius@kintel.net> | 2011-08-05 01:27:17 (GMT) |
---|---|---|
committer | Marius Kintel <marius@kintel.net> | 2011-08-05 01:27:17 (GMT) |
commit | 0340d4e0a1e3e8a74fdc13d04079d384f7906247 (patch) | |
tree | 98e899b2eca4b390cfbd80aab651e27841968109 /tests/opencsgtest.cc | |
parent | 38f50db0e061353b8ef7055a39357fcf6442d199 (diff) |
Improved view distance
Diffstat (limited to 'tests/opencsgtest.cc')
-rw-r--r-- | tests/opencsgtest.cc | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/tests/opencsgtest.cc b/tests/opencsgtest.cc index 30a5ffc..2eba509 100644 --- a/tests/opencsgtest.cc +++ b/tests/opencsgtest.cc @@ -211,6 +211,12 @@ int main(int argc, char *argv[]) QDir::setCurrent(original_path.absolutePath()); csgInfo.glview = new OffscreenView(512,512); + BoundingBox bbox = csgInfo.root_chain->getBoundingBox(); + + Vector3d center = (bbox.min() + bbox.max()) / 2; + double radius = (bbox.max() - bbox.min()).norm() / 2; + csgInfo.glview->setCamera(center[0], center[1] - 2 * radius, center[2], + center[0], center[1], center[2]); glewInit(); #ifdef DEBUG |