corrected setOrtho

This commit is contained in:
ganovelli 2011-12-07 13:15:28 +00:00
parent fb482d6757
commit f4010f0dce
1 changed files with 10 additions and 2 deletions

View File

@ -172,12 +172,20 @@ public:
int cameraType; /// Type of camera: PERSPECTIVE,ORTHO,ISOMETRIC,CAVALIERI
void SetOrtho(S dist)
void SetOrtho( S l,S r, S b, S t, vcg::Point2<int> viewport)
{
cameraType = ORTHO;
ViewportPx = ( ((ViewportPx[0] * PixelSizeMm[0]) * (ViewportPx[1] * PixelSizeMm[1])) / FocalMm ) * dist;
ViewportPx = viewport;
PixelSizeMm[0] = (r-l) / (S)ViewportPx[0];
PixelSizeMm[1] = (t-b) / (S)ViewportPx[1];
CenterPx[0] = -l/(r-l) * (S)ViewportPx[0];
CenterPx[1] = -b/(t-b) * (S)ViewportPx[1];
};
bool IsOrtho() const
{
return ( cameraType == ORTHO );