minor eroor correction on variable names
This commit is contained in:
parent
02f23020fc
commit
17ebec98c6
|
@ -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<S>::SetPerspective( S AngleDeg, S AspectRatio, S Focal, vcg::Point2<
|
|||
template<class S>
|
||||
void Camera<S>::SetFrustum( S sx, S dx, S bt, S tp, S Focal, vcg::Point2<int> 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<S>::SetFrustum( S sx, S dx, S bt, S tp, S Focal, vcg::Point2<int> 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;
|
||||
}
|
||||
|
|
|
@ -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<S> Shot<S>::Axis(const int & i) const
|
|||
template <class S>
|
||||
void Shot<S>::LookAt(const vcg::Point3<S> & z_dir,const vcg::Point3<S> & up)
|
||||
{
|
||||
LookTowards(z_dir-ViewPoint(),up);
|
||||
LookTowards(z_dir-GetViewPoint(),up);
|
||||
}
|
||||
|
||||
/// look at (opengl-like)
|
||||
|
|
|
@ -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<S> & camera,vcg::Point2<S> 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;
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -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<ScalarType> & 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<ScalarType> tra; tra.Import(tr.track.tra);
|
||||
vcg::Matrix44<ScalarType> trM; trM.FromMatrix(tr.track.Matrix());
|
||||
|
||||
vcg::Point3<ScalarType> vp = Inverse(trM)*(sShot.ViewPoint()-cen) +cen +tra;
|
||||
vcg::Point3<ScalarType> 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;
|
||||
|
|
Loading…
Reference in New Issue