本文整理汇总了C++中ViewExp::GetFOV方法的典型用法代码示例。如果您正苦于以下问题:C++ ViewExp::GetFOV方法的具体用法?C++ ViewExp::GetFOV怎么用?C++ ViewExp::GetFOV使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ViewExp
的用法示例。
在下文中一共展示了ViewExp::GetFOV方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: Inverse
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
{
;
}
}
}
示例2: filename
//.........这里部分代码省略.........
if(res.error() && _options->getShowErrMsg()){
static TCHAR szBuffer[256];
wsprintf(szBuffer,TEXT("Error writing file %s:\n%s"),
TEXT(filename.c_str()),res.message());
MessageBox (GetActiveWindow(), szBuffer, TEXT("Warning"),
MB_OK | MB_ICONWARNING) ;
}
if(!_options->getIncludeImageDataInIveFile()){
// Turn readerwriter options off again.
osgDB::ReaderWriter::Options* opt = new osgDB::ReaderWriter::Options();
osgDB::Registry::instance()->setOptions(opt);
}
}
else{
if(_options->getShowErrMsg()){
std::string error("Can not find plugin to save file: ");
error.append(name);
MessageBox (GetActiveWindow(), error.c_str() , TEXT("Warning"), MB_OK | MB_ICONWARNING) ;
}
}
_ip->ProgressEnd();
}
// Show quick preview
if(_options->getQuickView()){
float fNear = 1.0f;
float fFar = 1000.0f;
// Get the active viewport and the win32 window within it.
// The position and size will be retreive from this.
ViewExp* viewExp = _ip->GetActiveViewport();
float fov = viewExp->GetFOV();
HWND hWnd = viewExp->getGW()->getHWnd();
RECT sRect;
BOOL ok = GetWindowRect(hWnd, &sRect);
int width = 100;
int height = 100;
int x =100;
int y =100;
if(ok){
x = sRect.left;
y = sRect.top;
width = sRect.right - sRect.left;
height = sRect.bottom - sRect.top;
}
// Create previewer window and set size.
Previewer previewer;
previewer.setWindowSize(x, y, width, height);
// The affine TM transforms from world coords to view coords
// so we need the inverse of this matrix
Matrix3 aTM, camTM, coordSysTM;
Point3 viewDir, viewPos, lookAtPos, upVector;
INode* camera;
float dist = 100;
Point3 upperLeft = viewExp->MapScreenToView(IPoint2(0, 0), fFar);
Point3 lowerRight = viewExp->MapScreenToView(IPoint2(width, height), fFar);
viewExp->GetAffineTM(aTM);
coordSysTM = Inverse(aTM);