EgtGraphics 2.7b3 :

- in vista prospettica con zoom standard introdotto valore massimo per fov.
This commit is contained in:
SaraP
2025-02-19 16:16:59 +01:00
parent d9c9622972
commit 95bceba089
4 changed files with 39 additions and 18 deletions
+13 -3
View File
@@ -701,10 +701,20 @@ Scene::Prepare( void)
else {
// calcolo del fov : se dolly è costante, se zoom standard deve adattarsi alla vista
double dFov = PERSPECTIVE_STD_FOV ;
if ( m_nPerspZoomType == ZT_STD)
dFov = 2 * atan2( m_dHalfHeight, m_dDistCamera) * RADTODEG ;
double dRatio = m_dHalfWidth / m_dHalfHeight ;
if ( m_nPerspZoomType == ZT_STD) {
// verifico che il fov non superi il valore massimo consentito
if ( m_dHalfHeight / m_dDistCamera > PERSPECTIVE_TAN_MAX_FOV) {
dFov = PERSPECTIVE_MAX_FOV ;
// aggiusto i valori di HalfHeight e HalfWidth
m_dHalfHeight = m_dDistCamera * PERSPECTIVE_TAN_MAX_FOV ;
m_dHalfWidth = dRatio * m_dHalfHeight ;
}
else
dFov = 2 * atan2( m_dHalfHeight, m_dDistCamera) * RADTODEG ;
}
gluPerspective( abs( dFov), m_dHalfWidth / m_dHalfHeight, m_dZNear, m_dZFar) ;
gluPerspective( abs( dFov), dRatio, m_dZNear, m_dZFar) ;
}
// imposto matrice modello/vista