Command line: missing camera/projection causes NPE
Entirely omitting camera information with PNG output causes a NullPointerException:
Exception in thread "main" java.lang.NullPointerException
at org.osm2world.core.target.jogl.JOGLTarget.applyProjectionMatricesForPart(JOGLTarget.java:320)
at org.osm2world.core.target.jogl.JOGLTarget.renderPart(JOGLTarget.java:245)
at org.osm2world.console.ImageExporter.writeImageFile(ImageExporter.java:250)
at org.osm2world.console.Output.output(Output.java:159)
at org.osm2world.console.OSM2World.executeArgumentsGroup(OSM2World.java:199)
at org.osm2world.console.OSM2World.main(OSM2World.java:130)
It would be preferable to fall back to the bounds in the data file and/or print a better warning.
I believe what happens is that the fields initialized with null in Output.java keep that value because none of the if - else if blocks is reached, and it is then passed into the ImageExporter and JOGLTarget methods.
Excuse me, but to better understand this. The problem is that ConversionFacade cf is not properly set up in lines 53-75 because no conditional branch is triggered? And then something breaks when calling a method in JOGLTarget?
Thanks in advance.
The problem is actually in the section between the lines 84 and 134. The camera and projection variables are never set in some cases, which causes the NPE.