Patch fixes the bad assumption in osg fgfs that aspect ratio is always
4:3. I tested all the standard views and also resizing the window.
Would someone with cvs submit capability check the patch and then commit it.
- Dave P.
? renderer.diff
Index: renderer.cxx
===
RCS file: /var/cvs/FlightGear-0.9/source/src/Main/renderer.cxx,v
retrieving revision 1.100
diff -p -u -r1.100 renderer.cxx
--- renderer.cxx 6 Jan 2008 23:03:20 - 1.100
+++ renderer.cxx 15 Jan 2008 21:22:27 -
@@ -871,8 +871,9 @@ static float fov_far = 1000.0;
void FGRenderer::setFOV( float w, float h ) {
fov_width = w;
fov_height = h;
+float aspect_ratio = fgGetDouble(/sim/startup/xsize, 0.0)/fgGetDouble(/sim/startup/ysize, 0.0);
osgViewer::Viewer* viewer = globals-get_renderer()-getViewer();
-viewer-getCamera()-setProjectionMatrixAsPerspective(fov_height, 4.0/3.0,
+viewer-getCamera()-setProjectionMatrixAsPerspective(fov_height, aspect_ratio,
fov_near, fov_far);
}
@@ -885,8 +886,9 @@ void FGRenderer::setNearFar( float n, fl
n = 0.1;
fov_near = n;
fov_far = f;
+float aspect_ratio = fgGetDouble(/sim/startup/xsize, 0.0)/fgGetDouble(/sim/startup/ysize, 0.0);
osgViewer::Viewer* viewer = globals-get_renderer()-getViewer();
-viewer-getCamera()-setProjectionMatrixAsPerspective(fov_height, 4.0/3.0,
+viewer-getCamera()-setProjectionMatrixAsPerspective(fov_height, aspect_ratio,
fov_near, fov_far);
}
-
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse012070mrt/direct/01/___
Flightgear-devel mailing list
Flightgear-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/flightgear-devel