From Cory Riddell, fix for aspect ratio
This commit is contained in:
parent
306ebea772
commit
b93581e687
@ -116,6 +116,12 @@ void cOSG::InitCameraConfig(void)
|
||||
|
||||
// Realize the Viewer
|
||||
mViewer->realize();
|
||||
|
||||
// Correct aspect ratio
|
||||
double fovy,aspectRatio,z1,z2;
|
||||
mViewer->getCamera()->getProjectionMatrixAsPerspective(fovy,aspectRatio,z1,z2);
|
||||
aspectRatio=double(traits->width)/double(traits->height);
|
||||
mViewer->getCamera()->setProjectionMatrixAsPerspective(fovy,aspectRatio,z1,z2);
|
||||
}
|
||||
|
||||
void cOSG::PreFrameUpdate()
|
||||
|
Loading…
Reference in New Issue
Block a user