EgtGraphics :

- utilizzo di GetPixelZ anche per Pan della camera.
This commit is contained in:
Riccardo Elitropi
2026-02-09 12:26:56 +01:00
parent d2a457b1bd
commit 199ef1e26d
+6 -3
View File
@@ -319,12 +319,15 @@ bool
Scene::PanCamera( const Point3d& ptWinOld, const Point3d& ptWinNew)
{
// porto i due punti in coordinate mondo
double dZCenter = GetProjectedCenter().z ;
Point3d ptViewOld( ptWinOld.x, ptWinOld.y, dZCenter) ;
double dOldZCenter ;
GetPixelZ( ptWinOld, dOldZCenter) ;
Point3d ptViewOld( ptWinOld.x, ptWinOld.y, dOldZCenter) ;
Point3d ptWorldOld ;
if ( ! UnProject( ptViewOld, ptWorldOld))
return false ;
Point3d ptViewNew( ptWinNew.x, ptWinNew.y, dZCenter) ;
double dNewZCenter ;
GetPixelZ( ptWinNew, dNewZCenter) ;
Point3d ptViewNew( ptWinNew.x, ptWinNew.y, dNewZCenter) ;
Point3d ptWorldNew ;
if ( ! UnProject( ptViewNew, ptWorldNew))
return false ;