When opening a KML file which includes a gx:LatLonQuad (GXLatLonQuad) or a simple LatLonBox with a non-zero rotation, the call to clearFrame() in BasicSceneController fails with an OpenGL error (1286: Invalid Framebuffer).
Steps to Reproduce
Get or create a KML/KMZ file with a simple surface image.
Ensure the image is added as either a LatLonQuad or add any non-zero rotation.
Run gov.nasa.worldwindx.examples.KMLViewer.
Click File > Open..
Open your KML/KMZ file.
Expected behavior: Expect it to open the file and display the Surface Image correctly.
Actual behavior: Crashes in AbstractSceneController.clearFrame() with OpenGL error 1286 (Invalid Framebuffer.)
Reproduces how often: Every. Single. Time!
Operating System and Version
Windows 10, Java 8 (64-bit.)
Does NOT crash on macOS.
Additional Information
I was able to prevent the issue by adding this block of code to KMLSurfaceImageImpl.java around line 91.
Forcing the GXLatLonQuad into an un-rotated Sector and initializing the geometry with that prevents the issue. Also, forcing mustApplyRotation=false prevents the issue with a rotated LatLonBox.
String osName = System.getProperty("os.name");
boolean isWindows = (osName != null) && osName.toLowerCase().contains("windows");
if ( isWindows ) {
// Never allow rotation or it crashes.
this.mustApplyRotation = false;
// If it's a quad, just add it as a sector (which is by default aligned with the grid)
GXLatLongQuad latLonQuad = overlay.getLatLonQuad();
if (latLonQuad != null && latLonQuad.getCoordinates() != null)
{
ArrayList<LatLon> tmp = new ArrayList<LatLon>(4);
for (LatLon ll : latLonQuad.getCoordinates().list)
{
tmp.add(ll);
}
Sector tmpSector = Sector.boundingSector(tmp);
this.initializeGeometry(tmpSector);
}
}
@dwhipps, we have a community edition of WorldWind going. You can log this issue there along with a pull-request if you have one and we'll take a look at it.
Description
When opening a KML file which includes a gx:LatLonQuad (GXLatLonQuad) or a simple LatLonBox with a non-zero rotation, the call to clearFrame() in BasicSceneController fails with an OpenGL error (1286: Invalid Framebuffer).
Steps to Reproduce
Expected behavior: Expect it to open the file and display the Surface Image correctly.
Actual behavior: Crashes in AbstractSceneController.clearFrame() with OpenGL error 1286 (Invalid Framebuffer.)
Reproduces how often: Every. Single. Time!
Operating System and Version
Windows 10, Java 8 (64-bit.) Does NOT crash on macOS.
Additional Information
I was able to prevent the issue by adding this block of code to KMLSurfaceImageImpl.java around line 91.
Forcing the GXLatLonQuad into an un-rotated Sector and initializing the geometry with that prevents the issue. Also, forcing mustApplyRotation=false prevents the issue with a rotated LatLonBox.