diff options
author | clifford <clifford@b57f626f-c46c-0410-a088-ec61d464b74c> | 2009-06-25 19:53:12 (GMT) |
---|---|---|
committer | clifford <clifford@b57f626f-c46c-0410-a088-ec61d464b74c> | 2009-06-25 19:53:12 (GMT) |
commit | c318b749b12a2d51115c65a9ad8c9f45396a90d8 (patch) | |
tree | d9ac615c0b15a37d3df319bc6ccc1246416a32a1 /glview.cc | |
parent | 1ef41a174f64d8ae98d2f727eef9a7613f85934c (diff) |
Clifford Wolf:
Fixed OpenGL viewport init
Added sphere primitive
Fixed building without OpenCSG
git-svn-id: http://svn.clifford.at/openscad/trunk@21 b57f626f-c46c-0410-a088-ec61d464b74c
Diffstat (limited to 'glview.cc')
-rw-r--r-- | glview.cc | 5 |
1 files changed, 3 insertions, 2 deletions
@@ -51,7 +51,8 @@ void GLView::initializeGL() void GLView::resizeGL(int w, int h) { - glViewport(0, 0, (GLint)w, (GLint)h); + glViewport(0, 0, w, h); + w_h_ratio = sqrt((double)w / (double)h); } void GLView::paintGL() @@ -60,7 +61,7 @@ void GLView::paintGL() glMatrixMode(GL_PROJECTION); glLoadIdentity(); - glFrustum(-1.0, +1.0, -1.0, +1.0, +10.0, +FAR_FAR_AWAY); + glFrustum(-w_h_ratio, +w_h_ratio, -(1/w_h_ratio), +(1/w_h_ratio), +10.0, +FAR_FAR_AWAY); gluLookAt(0.0, -viewer_distance, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 1.0); glMatrixMode(GL_MODELVIEW); |