[Nasa-exp-checkins] WorldWind/PluginSDK LatLongGrid.cs,1.5,1.6
Brought to you by:
baker99-bull,
vigilant
From: Bjorn R. \(B. Reppen\) <mas...@us...> - 2005-06-30 01:15:37
|
Update of /cvsroot/nasa-exp/WorldWind/PluginSDK In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv5537/PluginSDK Modified Files: LatLongGrid.cs Log Message: WW-295: Parts of Lat/Lon grid disappear near poles when tilted Index: LatLongGrid.cs =================================================================== RCS file: /cvsroot/nasa-exp/WorldWind/PluginSDK/LatLongGrid.cs,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** LatLongGrid.cs 27 Jun 2005 16:31:18 -0000 1.5 --- LatLongGrid.cs 30 Jun 2005 01:15:28 -0000 1.6 *************** *** 111,115 **** // Draw longitude label ! float lat = (float)(drawArgs.WorldCamera.Latitude + drawArgs.WorldCamera.ViewRange * 0.15 ).Degrees; if(lat > 70) lat = 70; --- 111,115 ---- // Draw longitude label ! float lat = (float)(drawArgs.WorldCamera.Latitude).Degrees; if(lat > 70) lat = 70; *************** *** 140,144 **** { // Draw latitude label ! float longitude = (float)(drawArgs.WorldCamera.Longitude + drawArgs.WorldCamera.ViewRange*0.25f).Degrees; Vector3 v = MathEngine.SphericalToCartesian(latitude, longitude, WorldRadius); if(drawArgs.WorldCamera.ViewFrustum.ContainsPoint(v)) --- 140,144 ---- { // Draw latitude label ! float longitude = (float)(drawArgs.WorldCamera.Longitude).Degrees; Vector3 v = MathEngine.SphericalToCartesian(latitude, longitude, WorldRadius); if(drawArgs.WorldCamera.ViewFrustum.ContainsPoint(v)) *************** *** 156,160 **** s += "S"; System.Drawing.Rectangle rect = new System.Drawing.Rectangle((int)v.X, (int)v.Y, 10, 10); ! drawArgs.defaultDrawingFont.DrawText(null,s, rect.Left, rect.Top, World.Settings.latLonLinesColor); } --- 156,160 ---- s += "S"; System.Drawing.Rectangle rect = new System.Drawing.Rectangle((int)v.X, (int)v.Y, 10, 10); ! drawArgs.defaultDrawingFont.DrawText(null, s, rect.Left, rect.Top, World.Settings.latLonLinesColor); } *************** *** 261,273 **** public void ComputeGridValues(DrawArgs drawArgs) { ! LatitudeInterval = 10; ! double vr = drawArgs.WorldCamera.ViewRange.Radians*0.75; ! if(vr < 0.1) LatitudeInterval = 1; ! else if(vr < 0.3) LatitudeInterval = 2; ! else if(vr < 1.1) LatitudeInterval = 5; LongitudeInterval = LatitudeInterval; --- 261,277 ---- public void ComputeGridValues(DrawArgs drawArgs) { ! double vr = drawArgs.WorldCamera.ViewRange.Radians; ! ! // Compensate for closer grid towards poles ! vr *= 1+Math.Abs(Math.Sin(drawArgs.WorldCamera.Latitude.Radians)); ! if(vr < 0.4) LatitudeInterval = 1; ! else if(vr < 0.6) LatitudeInterval = 2; ! else if(vr < 1.0) LatitudeInterval = 5; + else + LatitudeInterval = 10; LongitudeInterval = LatitudeInterval; |