From Cory Riddell, fix for aspect ratio

This commit is contained in:
Robert Osfield 2009-04-08 14:08:16 +00:00
parent 306ebea772
commit b93581e687

View File

@ -116,6 +116,12 @@ void cOSG::InitCameraConfig(void)
// Realize the Viewer // Realize the Viewer
mViewer->realize(); 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() void cOSG::PreFrameUpdate()