mirror of
https://github.com/ultimatepp/ultimatepp.git
synced 2026-07-11 22:03:01 -06:00
*GLCanvas. Fixed division by zero
git-svn-id: svn://ultimatepp.org/upp/trunk@15294 f0d560ea-af0d-0410-9eb7-867de7ffcac7
This commit is contained in:
parent
880b801ec6
commit
5568cac7d1
1 changed files with 2 additions and 1 deletions
|
|
@ -222,7 +222,8 @@ void GLCanvas::SetCamera() {
|
|||
glMatrixMode(GL_PROJECTION);
|
||||
glLoadIdentity();
|
||||
double angle = trackBall.GetZoomAngle();
|
||||
gluPerspective(angle, static_cast<float>(GetSize().cx)/GetSize().cy, 1, 10000);
|
||||
float aspect = GetSize().cy == 0 ? 1 : static_cast<float>(GetSize().cx)/GetSize().cy;
|
||||
gluPerspective(angle, aspect, 1, 10000);
|
||||
glMatrixMode(GL_MODELVIEW);
|
||||
glLoadIdentity();
|
||||
gluLookAt(0.0, 0.0, static_cast<float>(GetSize().cy/2.), 0.0, 0.0, 0.0, 0.0, 1.0, 0.0);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue