void U2MaxCameraExport::ExtractFromViewport(Interface* pIf) { ViewExp* viewport = pIf->GetActiveViewport(); if(viewport) { Matrix3 modelView, invModelView; viewport->GetAffineTM(modelView); invModelView = Inverse(modelView); Point3 up = invModelView.GetRow(0); // up Point3 right = invModelView.GetRow(1); // right Point3 look = invModelView.GetRow(2); Point3 eye = invModelView.GetRow(3); float fFov = viewport->GetFOV(); BOOL bIsPerp = viewport->IsPerspView(); pIf->ReleaseViewport(viewport); if(bIsPerp) { ; } else { ; } } }
static BOOL clipgrid(Point3 wp, ViewExp& vpt) { if ( ! vpt.IsAlive() ) { // why are we here DbgAssert(!_T("Invalid viewport!")); return FALSE; } if(!vpt.IsPerspView()) return TRUE; float minx, miny, maxx, maxy; vpt.GetGridDims(&minx, &maxx, &miny, &maxy); if(wp.x > minx && wp.x < maxx && wp.y > miny && wp.y < maxy) return TRUE; return FALSE; }