From 17ebec98c6f021c98722d55feeb9b71796ca05c9 Mon Sep 17 00:00:00 2001 From: matteodelle Date: Mon, 18 Dec 2006 16:02:57 +0000 Subject: [PATCH] minor eroor correction on variable names --- vcg/math/camera.h | 17 ++++++++++------- vcg/math/shot.h | 5 ++++- wrap/gl/camera.h | 9 ++++++--- wrap/gl/shot.h | 19 +++++++++++-------- 4 files changed, 31 insertions(+), 19 deletions(-) diff --git a/vcg/math/camera.h b/vcg/math/camera.h index 2a3f9220..b522daff 100644 --- a/vcg/math/camera.h +++ b/vcg/math/camera.h @@ -23,6 +23,9 @@ /**************************************************************************** History $Log: not supported by cvs2svn $ +Revision 1.26 2006/12/18 09:46:38 callieri +camera+shot revamp: changed field names to something with more sense, cleaning of various functions, correction of minor bugs/incongruences, removal of the infamous reference in shot. + Revision 1.25 2005/12/12 16:52:55 callieri Added Unproject, from 2D local space + Zdepth to 3D camera space. Added ViewportToLocal, inverse of LocalToViewport @@ -298,9 +301,9 @@ void Camera::SetPerspective( S AngleDeg, S AspectRatio, S Focal, vcg::Point2< template void Camera::SetFrustum( S sx, S dx, S bt, S tp, S Focal, vcg::Point2 Viewport) { - S vpt[2]; - vpt[0] = dx-sx; - vpt[1] = tp-bt; + S vp[2]; + vp[0] = dx-sx; + vp[1] = tp-bt; ViewportPx[0] = vp[0]; if(vp[1] != -1) @@ -308,11 +311,11 @@ void Camera::SetFrustum( S sx, S dx, S bt, S tp, S Focal, vcg::Point2 Vi else ViewportPx[1] = ViewportPx[0]; // default viewport - PixelSizeMm[0] = vpt[0] / (S)Viewport[0]; - PixelSizeMm[1] = vpt[1] / (S)Viewport[1]; + PixelSizeMm[0] = vp[0] / (S)Viewport[0]; + PixelSizeMm[1] = vp[1] / (S)Viewport[1]; - CenterPx[0] = -sx/vpt[0] * (S)Viewport[0]; - CenterPx[1] = -bt/vpt[1] * (S)Viewport[1]; + CenterPx[0] = -sx/vp[0] * (S)Viewport[0]; + CenterPx[1] = -bt/vp[1] * (S)Viewport[1]; FocalMm =Focal; } diff --git a/vcg/math/shot.h b/vcg/math/shot.h index a6031253..0f55717b 100644 --- a/vcg/math/shot.h +++ b/vcg/math/shot.h @@ -23,6 +23,9 @@ /**************************************************************************** History $Log: not supported by cvs2svn $ +Revision 1.20 2006/12/18 09:46:39 callieri +camera+shot revamp: changed field names to something with more sense, cleaning of various functions, correction of minor bugs/incongruences, removal of the infamous reference in shot. + Revision 1.19 2006/01/22 17:01:40 cignoni Corrected intialization of flag, must be zero. @@ -178,7 +181,7 @@ vcg::Point3 Shot::Axis(const int & i) const template void Shot::LookAt(const vcg::Point3 & z_dir,const vcg::Point3 & up) { - LookTowards(z_dir-ViewPoint(),up); + LookTowards(z_dir-GetViewPoint(),up); } /// look at (opengl-like) diff --git a/wrap/gl/camera.h b/wrap/gl/camera.h index ae82d41f..da21db4f 100644 --- a/wrap/gl/camera.h +++ b/wrap/gl/camera.h @@ -23,6 +23,9 @@ /**************************************************************************** History $Log: not supported by cvs2svn $ +Revision 1.13 2006/12/18 14:28:07 matteodelle +*** empty log message *** + Revision 1.12 2006/12/18 09:46:39 callieri camera+shot revamp: changed field names to something with more sense, cleaning of various functions, correction of minor bugs/incongruences, removal of the infamous reference in shot. @@ -181,10 +184,10 @@ static void SetSubView(vcg::Camera & camera,vcg::Point2 p0,S nearDist, S f switch(camera.cameraType) { - case vcg::PERSPECTIVE: glfarDistustum( width* p0[0]+ sx, width* p1[0]+ sx, height* p0[1]+ bt, height* p1[1]+bt,nearDist,farDist); break; + case vcg::PERSPECTIVE: glFrustum( width* p0[0]+ sx, width* p1[0]+ sx, height* p0[1]+ bt, height* p1[1]+bt,nearDist,farDist); break; case vcg::ORTHO: glOrtho(width* p0[0]+sx, width* p1[0]+sx, height* p0[1]+ bt, height* p1[1]+bt,nearDist,farDist); break; - case vcg::ISOMETRIC: IsometricProj(dx-width* p1[0], dx-width* p0[0], tp-height* p1[1], tp-height* p0[1],nearDist,farDist); break; - case vcg::CAVALIERI: CavalieriProj(dx-width* p1[0], dx-width* p0[0], tp-height* p1[1], tp-height* p0[1],nearDist,farDist); break; + //case vcg::ISOMETRIC: IsometricProj(dx-width* p1[0], dx-width* p0[0], tp-height* p1[1], tp-height* p0[1],nearDist,farDist); break; + //case vcg::CAVALIERI: CavalieriProj(dx-width* p1[0], dx-width* p0[0], tp-height* p1[1], tp-height* p0[1],nearDist,farDist); break; } diff --git a/wrap/gl/shot.h b/wrap/gl/shot.h index e17ea669..912a086a 100644 --- a/wrap/gl/shot.h +++ b/wrap/gl/shot.h @@ -23,6 +23,9 @@ /**************************************************************************** History $Log: not supported by cvs2svn $ +Revision 1.11 2006/12/18 15:26:24 callieri +added a function to approximate a far plane value given a shot and the mesh bbox + Revision 1.10 2006/12/18 14:28:07 matteodelle *** empty log message *** @@ -34,11 +37,11 @@ Revision 1.8 2006/01/11 16:06:25 matteodelle Revision 1.8 2005/01/11 17:06:30 dellepiane -FromTrackball() coorected (similarity->Similarity() +FromTrackball() coorected (similarity->Extrinsics Revision 1.7 2005/11/25 10:33:33 spinelli -shot.camera -> shot.Camera() -shot.similarity.Matrix() -> shot.Similarity().Matrix() +shot.camera -> shot.Intrinsics +shot.similarity.Matrix() -> shot.Extrinsics.Matrix() Revision 1.6 2005/02/22 11:15:01 ganovelli added vcg namespace @@ -170,7 +173,7 @@ static void SetSubView(vcg::Shot & shot, glPushMatrix(); glLoadIdentity(); assert(glGetError() == 0); - GlCameraType::SetSubView(shot.Intrinsics,p1,p2); + GlCameraType::SetSubView(shot.Intrinsics,p1,0,1000,p2); assert(glGetError() == 0); glMatrixMode(GL_MODELVIEW); glPushMatrix(); @@ -195,11 +198,11 @@ static void FromTrackball(const vcg::Trackball & tr, vcg::Point3 tra; tra.Import(tr.track.tra); vcg::Matrix44 trM; trM.FromMatrix(tr.track.Matrix()); - vcg::Point3 vp = Inverse(trM)*(sShot.ViewPoint()-cen) +cen +tra; + vcg::Point3 vp = Inverse(trM)*(sShot.GetViewPoint()-cen) +cen +tra; shot.SetViewPoint(vp); - shot.Similarity().rot = sShot.Similarity().rot*trM; - shot.Similarity().sca = sShot.Similarity().sca*(ScalarType)tr.track.sca; + shot.Extrinsics.rot = sShot.Extrinsics.rot*trM; + shot.Extrinsics.sca = sShot.Extrinsics.sca*(ScalarType)tr.track.sca; } }; #endif @@ -382,7 +385,7 @@ static void FromTrackball(const vcg::Trackball & tr, // } // } // -// inline Camera() +// inline Intrinsics // { // k[0]=k[1]=k[2]=k[3]=0.0; // valid = false;