diff --git a/src/pulsaranimationwidget.cpp b/src/pulsaranimationwidget.cpp index 7d982b7c568f1e45430246d5a87976c783fdcc2b..6817facc2ebfa850e7bf0d9225a47c50925f6e76 100644 --- a/src/pulsaranimationwidget.cpp +++ b/src/pulsaranimationwidget.cpp @@ -94,8 +94,9 @@ PulsarAnimationWidget::PulsarAnimationWidget(QWidget *parent) : // initial view settings m_mouseAngleH = 90.0; m_mouseAngleV = 30.0; - m_cameraZoom = 15.0; - m_cameraZoomLBound = 2.0; + m_cameraZoom = 150.0; + m_cameraZoomLBound = 10.0; + m_cameraZoomUBound = 4500.0; m_mouseLastX = 0; m_mouseLastY = 0; @@ -235,7 +236,7 @@ void PulsarAnimationWidget::resizeGL(int w, int h) glMatrixMode(GL_PROJECTION); glLoadIdentity(); - gluPerspective(45.0, (GLfloat)w / (GLfloat)h, 0.1, 500.0); + gluPerspective(4.5, (GLfloat)w / (GLfloat)h, 0.1, 5000.0); glMatrixMode(GL_MODELVIEW); glLoadIdentity(); @@ -491,6 +492,7 @@ void PulsarAnimationWidget::mouseMoveEvent(QMouseEvent *event) if(m_mouseLastY != 0) { m_cameraZoom -= (m_mouseLastY - event->y()); m_cameraZoom = m_cameraZoom >= m_cameraZoomLBound ? m_cameraZoom : m_cameraZoomLBound; + m_cameraZoom = m_cameraZoom >= m_cameraZoomUBound ? m_cameraZoomUBound : m_cameraZoom; } m_mouseLastY = event->y(); diff --git a/src/pulsaranimationwidget.h b/src/pulsaranimationwidget.h index c060f1de3f36cb5f7d361c920d5f6a0a060075ca..65093fadb7ef7cb49271d60f26f09c8c8b0809d1 100644 --- a/src/pulsaranimationwidget.h +++ b/src/pulsaranimationwidget.h @@ -118,6 +118,7 @@ private: int m_mouseAngleV; double m_cameraZoom; double m_cameraZoomLBound; + double m_cameraZoomUBound; double m_cameraPosX; double m_cameraPosY; double m_cameraPosZ;