EgtGraphics :
- piccoli aggiustamenti su ZoomOnPoint e ZoomWin per impostazione centro vista.
This commit is contained in:
+6
-9
@@ -540,13 +540,6 @@ Scene::ZoomOnPoint( const Point3d& ptWin, double dCoeff)
|
||||
if ( ! UnProject( ptView, ptWorld))
|
||||
return false ;
|
||||
|
||||
// verifico che il punto sia nelle dimensioni del mondo geometrico
|
||||
if ( ! m_b3ExtWorld.IsEmpty() && ! m_b3ExtWorld.Encloses( ptWorld)) {
|
||||
ptWorld.x = Clamp( ptWorld.x, m_b3ExtWorld.GetMin().x, m_b3ExtWorld.GetMax().x) ;
|
||||
ptWorld.y = Clamp( ptWorld.y, m_b3ExtWorld.GetMin().y, m_b3ExtWorld.GetMax().y) ;
|
||||
ptWorld.z = Clamp( ptWorld.z, m_b3ExtWorld.GetMin().z, m_b3ExtWorld.GetMax().z) ;
|
||||
}
|
||||
|
||||
// modifico opportunamente il centro di vista
|
||||
Point3d ptOldCen = m_ptCenter ;
|
||||
Point3d ptNewCen = ptWorld + ( m_ptCenter - ptWorld) * dCoeff ;
|
||||
@@ -583,12 +576,16 @@ Scene::ZoomOnPoint( const Point3d& ptWin, double dCoeff)
|
||||
bool
|
||||
Scene::ZoomWin( const Point3d& ptWin1, const Point3d& ptWin2)
|
||||
{
|
||||
// leggo Z del pixel
|
||||
double dWinZ ;
|
||||
GetPixelZ( Media( ptWin1, ptWin2), dWinZ) ;
|
||||
|
||||
// porto i punti in coordinate mondo
|
||||
Point3d ptWorld1 ;
|
||||
if ( ! UnProject( Point3d( ptWin1.x, ptWin1.y, GetProjectedCenter().z), ptWorld1))
|
||||
if ( ! UnProject( Point3d( ptWin1.x, ptWin1.y, dWinZ), ptWorld1))
|
||||
return false ;
|
||||
Point3d ptWorld2 ;
|
||||
if ( ! UnProject( Point3d( ptWin2.x, ptWin2.y, GetProjectedCenter().z), ptWorld2))
|
||||
if ( ! UnProject( Point3d( ptWin2.x, ptWin2.y, dWinZ), ptWorld2))
|
||||
return false ;
|
||||
|
||||
// recupero il riferimento della camera (vista)
|
||||
|
||||
Reference in New Issue
Block a user