Good news is that i tried to integrate the jReality into WorldWind as a layer, Bad news is the method causes error in jPCT.
I downloaded the jReality's source code and compiled them in Eclipse+maven. Although some .jars are missed, it works.
Then, i look into its Viewer and Render(with the same name JOGLRender as jPCT), and comment some camera and projection gl operations, especially those for sky background.
When i write a WW's layer, called jrealityLayer, as JpctLayer, it has the same problem.
I can see the 3d object, but it will be covered by other layers.
Fortunatly, i find the way:
1. comment the camera's gl matrix operations.
2. comment the projection matrix operation
3. comment the background drawing
4. add a coord matrix as that in the former cube demo
5. add a projection matrix before step 4. --this is the key step, i think.
Now, i can see the 3d object as that in the cube demo.
The following is the jrealityLayer and a simple view for the layer.
the key step is :
I set the local coord as in cube demo, and adjust the projection/modelview matrix.
The source code JOGLRenderer.java is a bit long, so i list the commented codes:
The listed two method do the drawing works.
Then, i tried to use the same key step in jPCTLayer, but failed.
The output is:
Without source code, i do not know what is going on and what goes wrong.
I can only guess that something is not initialized or entitled a wrong value.
I downloaded the jReality's source code and compiled them in Eclipse+maven. Although some .jars are missed, it works.
Then, i look into its Viewer and Render(with the same name JOGLRender as jPCT), and comment some camera and projection gl operations, especially those for sky background.
When i write a WW's layer, called jrealityLayer, as JpctLayer, it has the same problem.
I can see the 3d object, but it will be covered by other layers.
Fortunatly, i find the way:
1. comment the camera's gl matrix operations.
2. comment the projection matrix operation
3. comment the background drawing
4. add a coord matrix as that in the former cube demo
5. add a projection matrix before step 4. --this is the key step, i think.
Now, i can see the 3d object as that in the cube demo.
The following is the jrealityLayer and a simple view for the layer.
Code Select
package org.aoe.det.ww.d3man.ww;
import gov.nasa.worldwind.geom.Matrix;
import gov.nasa.worldwind.geom.Position;
import gov.nasa.worldwind.geom.Vec4;
import gov.nasa.worldwind.layers.AbstractLayer;
import gov.nasa.worldwind.render.DrawContext;
import gov.nasa.worldwind.util.OGLUtil;
import javax.media.opengl.GL;
import javax.media.opengl.GL2;
import org.aoe.det.ww.d3man.D3Man;
import de.jreality.geometry.Primitives;
import de.jreality.jogl4ww.Jogl4WWViewer;
import de.jreality.math.MatrixBuilder;
import de.jreality.scene.Appearance;
import de.jreality.scene.Camera;
import de.jreality.scene.DirectionalLight;
import de.jreality.scene.IndexedFaceSet;
import de.jreality.scene.Light;
import de.jreality.scene.SceneGraphComponent;
import de.jreality.scene.SceneGraphPath;
import de.jreality.shader.Color;
import de.jreality.shader.CommonAttributes;
import de.jreality.tools.RotateTool;
public class JrealityLayer extends AbstractLayer {
public Jogl4WWViewer viewer;
public SceneGraphComponent rootNode;
public SceneGraphComponent cameraNode;
public SceneGraphComponent lightNode;
public SceneGraphComponent geometryNode;
public JrealityLayer() {
// do nothing
}
// puts opengl in the correct state for this layer
protected void beginDraw(DrawContext dc) {
GL2 gl = (GL2) dc.getGL();
// gl.glPushAttrib(GL2.GL_TEXTURE_BIT | GL2.GL_ENABLE_BIT
// | GL2.GL_CURRENT_BIT | GL2.GL_TRANSFORM_BIT);
gl.glPushAttrib(GL2.GL_ALL_ATTRIB_BITS);
// if (!dc.isPickingMode()) {
// gl.glEnable(GL.GL_BLEND);
// gl.glBlendFunc(GL.GL_SRC_ALPHA, GL.GL_ONE_MINUS_SRC_ALPHA);
// }
if (!dc.isPickingMode()) {
dc.beginStandardLighting();
gl.glEnable(GL.GL_BLEND);
OGLUtil.applyBlending(gl, false);
// Were applying a scale transform on the modelview matrix, so the
// normal vectors must be re-normalized
// before lighting is computed.
gl.glEnable(GL2.GL_NORMALIZE);
}
gl.glMatrixMode(GL2.GL_MODELVIEW);// |GL2.GL_PROJECTION|GL2.GL_TEXTURE);
gl.glPushMatrix();
gl.glLoadIdentity();
gl.glMatrixMode(GL2.GL_PROJECTION);
gl.glPushMatrix();
gl.glLoadIdentity();
gl.glMatrixMode(GL2.GL_TEXTURE);
gl.glPushMatrix();
gl.glLoadIdentity();
gl.glMatrixPushEXT(GL2.GL_MODELVIEW);
gl.glMatrixPushEXT(GL2.GL_PROJECTION);
gl.glMatrixPushEXT(GL2.GL_TEXTURE);
// Multiply the modelview matrix by a surface orientation matrix to set
// up a local coordinate system with the
// origin at the cube's center position, the Y axis pointing North, the
// X axis pointing East, and the Z axis
// normal to the globe.
// the local coord O--> WW's (0-latitude, 20-longitude,
// 1000-metersElevation)
Position pos = Position.fromDegrees(0, 20);
double[] matrixArray;
Matrix posMatrix, matrix;
posMatrix = dc.getGlobe().computeSurfaceOrientationAtPosition(// boxPos);
pos.latitude, pos.longitude, -D3Man.surfaceElevation);//
matrix = dc.getView().getProjectionMatrix().multiply(posMatrix);
matrixArray = new double[16];
matrix.toArray(matrixArray, 0, false);
gl.glMatrixMode(GL2.GL_PROJECTION);
gl.glLoadMatrixd(matrixArray, 0);
matrix = dc.getView().getModelviewMatrix().multiply(posMatrix);
matrixArray = new double[16];
matrix.toArray(matrixArray, 0, false);
gl.glMatrixMode(GL2.GL_MODELVIEW);
gl.glLoadMatrixd(matrixArray, 0);
}
/**
* Called by WorldWind to refresh this layer.
*/
@Override
protected void doRender(DrawContext dc) {
this.beginDraw(dc);
GL2 gl = dc.getGL().getGL2();
if (this.viewer == null) {
rootNode = new SceneGraphComponent();
cameraNode = new SceneGraphComponent();
geometryNode = new SceneGraphComponent();
lightNode = new SceneGraphComponent();
rootNode.addChild(geometryNode);
rootNode.addChild(cameraNode);
cameraNode.addChild(lightNode);
Light dl = new DirectionalLight();
lightNode.setLight(dl);
Camera camera = new Camera();
cameraNode.setCamera(camera);
IndexedFaceSet ifs = Primitives.icosahedron();
geometryNode.setGeometry(ifs);
RotateTool rotateTool = new RotateTool();
geometryNode.addTool(rotateTool);
MatrixBuilder.euclidean().translate(0, 0, 1).assignTo(cameraNode);
MatrixBuilder.euclidean().translate(0, 0, 0).assignTo(geometryNode);
// MatrixBuilder.euclidean().scale(20.0).assignTo(geometryNode);
// MatrixBuilder.euclidean().rotateZ(20.0).assignTo(geometryNode);
Appearance rootApp = new Appearance();
// rootApp.setAttribute(CommonAttributes.BACKGROUND_COLOR,
// new Color(0f, 1.0f, .1f));
rootApp.setAttribute(CommonAttributes.DIFFUSE_COLOR,
new Color(1f, 1f, 1f));
rootNode.setAppearance(rootApp);
SceneGraphPath camPath = new SceneGraphPath();
camPath.push(rootNode);
camPath.push(cameraNode);
camPath.push(camera);
viewer = new Jogl4WWViewer();
viewer.initialize(gl, camPath, rootNode);
}
viewer.reInitGL(gl, 0, 0, dc.getDrawableWidth(),
dc.getDrawableHeight());
//set camera
// Vec4 eyeLoc = dc.getView().getEyePoint();
// MatrixBuilder.euclidean().translate(eyeLoc.x, eyeLoc.y, eyeLoc.z).assignTo(cameraNode);
viewer.render();
this.endDraw(dc);
}
// resets opengl state
protected void endDraw(DrawContext dc) {
GL2 gl = (GL2) dc.getGL();
gl.glMatrixPopEXT(GL2.GL_TEXTURE);
gl.glMatrixPopEXT(GL2.GL_PROJECTION);
gl.glMatrixPopEXT(GL2.GL_MODELVIEW);
gl.glMatrixMode(GL2.GL_TEXTURE);
gl.glPopMatrix();
gl.glMatrixMode(GL2.GL_PROJECTION);
gl.glPopMatrix();
gl.glMatrixMode(GL2.GL_MODELVIEW);// |GL2.GL_PROJECTION|GL2.GL_TEXTURE);
gl.glPopMatrix();
if (!dc.isPickingMode()) {
dc.endStandardLighting();
}
gl.glPopAttrib();
}
}
/**
*
* This file is part of jReality. jReality is open source software, made
* available under a BSD license:
*
* Copyright (c) 2003-2006, jReality Group: Charles Gunn, Tim Hoffmann, Markus
* Schmies, Steffen Weissmann.
*
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* - Redistributions of source code must retain the above copyright notice, this
* list of conditions and the following disclaimer.
*
* - Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
*
* - Neither the name of jReality nor the names of its contributors nor the
* names of their associated organizations may be used to endorse or promote
* products derived from this software without specific prior written
* permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*
*/
package de.jreality.jogl4ww;
import java.awt.Dimension;
import java.util.logging.Level;
import javax.media.opengl.GL;
import javax.media.opengl.GL2;
import javax.media.opengl.GLContext;
import javax.media.opengl.GLDrawableFactory;
import org.eclipse.swt.SWT;
import org.eclipse.swt.graphics.Point;
import org.eclipse.swt.graphics.Rectangle;
import org.eclipse.swt.opengl.GLCanvas;
import org.eclipse.swt.widgets.Event;
import org.eclipse.swt.widgets.Listener;
import de.jreality.jogl.JOGLConfiguration;
import de.jreality.jogl.JOGLRenderer;
import de.jreality.scene.SceneGraphComponent;
import de.jreality.scene.SceneGraphPath;
import de.jreality.util.SceneGraphUtility;
/**
* a viewer for NASA WorldWind, with injected GL2 object.
*
* @author berg
*
*/
public class Jogl4WWViewer implements de.jreality.scene.Viewer {
private SceneGraphComponent sceneRoot;
private SceneGraphComponent auxiliaryRoot;
private SceneGraphPath cameraPath;
private JOGLRenderer renderer;
public static final int CROSS_EYED_STEREO = 0;
public static final int RED_BLUE_STEREO = 1;
public static final int RED_GREEN_STEREO = 2;
public static final int RED_CYAN_STEREO = 3;
public static final int HARDWARE_BUFFER_STEREO = 4;
public static final int STEREO_TYPES = 5;
int stereoType = CROSS_EYED_STEREO;
private GL2 gl;
private int metric;
public Jogl4WWViewer() {
super();
}
/**
* initialize this viewer with given params.
* @param gl
* @param camPath
* @param root
*/
public void initialize(GL2 gl, SceneGraphPath camPath, SceneGraphComponent root) {
this.gl = gl;
setAuxiliaryRoot(SceneGraphUtility
.createFullSceneGraphComponent("AuxiliaryRoot"));
this.setSceneRoot(root);
this.setCameraPath(camPath);
this.renderer = new JOGLRenderer(this);
this.renderer.init(this.gl);
}
public SceneGraphComponent getSceneRoot() {
return sceneRoot;
}
public void setSceneRoot(SceneGraphComponent r) {
if (r == null) {
JOGLConfiguration.getLogger().log(Level.WARNING,
"Null scene root, not setting.");
return;
}
sceneRoot = r;
}
public SceneGraphComponent getAuxiliaryRoot() {
return auxiliaryRoot;
}
public void setAuxiliaryRoot(SceneGraphComponent auxiliaryRoot) {
this.auxiliaryRoot = auxiliaryRoot;
if (renderer != null)
renderer.setAuxiliaryRoot(auxiliaryRoot);
}
public SceneGraphPath getCameraPath() {
return cameraPath;
}
public void setCameraPath(SceneGraphPath p) {
cameraPath = p;
}
public void renderAsync() {
this.render();
}
public boolean hasViewingComponent() {
return false;
}
public Object getViewingComponent() {
return this.gl;
}
public int getMetric() {
return metric;
}
public void setMetric(int metric) {
this.metric = metric;
SceneGraphUtility.setMetric(sceneRoot, metric);
}
/*********** Non-standard set/get ******************/
public void setStereoType(int type) {
renderer.setStereoType(type);
}
// used in JOGLRenderer
public int getStereoType() {
return renderer.getStereoType();
}
// public boolean isFlipped() {
// return renderer.isFlipped();
// }
// public void setFlipped(boolean isFlipped) {
// renderer.setFlipped(isFlipped);
// }
//
public JOGLRenderer getRenderer() {
return renderer;
}
/****** Convenience methods ************/
public void addAuxiliaryComponent(SceneGraphComponent aux) {
if (auxiliaryRoot == null) {
setAuxiliaryRoot(SceneGraphUtility
.createFullSceneGraphComponent("AuxiliaryRoot"));
}
if (!auxiliaryRoot.isDirectAncestor(aux))
auxiliaryRoot.addChild(aux);
}
public void removeAuxiliaryComponent(SceneGraphComponent aux) {
if (auxiliaryRoot == null)
return;
if (!auxiliaryRoot.isDirectAncestor(aux))
return;
auxiliaryRoot.removeChild(aux);
}
private boolean pendingUpdate;
private final Object renderLock = new Object();
boolean autoSwapBuffers = true;
public boolean isRendering() {
synchronized (renderLock) {
return pendingUpdate;
}
}
boolean init = true;
int rot = 0;
private int gl_x;
private int gl_y;
private int gl_right;
private int gl_top;
/**
* re-initialized when the gl or viewport is changed.
* @param gl
* @param x
* @param y
* @param right
* @param top
*/
public void reInitGL(GL2 gl, int x, int y, int right,
int top) {
if (this.gl != gl){
this.renderer.init(gl);
}
if (gl_x != x || gl_y != y
|| gl_right != right || gl_top != top) {
this.gl_x = x;
this.gl_y = y;
this.gl_right = right;
this.gl_top = top;
this.renderer.reshape(this.gl, x, y, right, top);
}
}
public double getAspectRatio() {
return renderer.getAspectRatio();
}
public Dimension getViewingComponentSize() {
return new Dimension(gl_right-gl_x, gl_top-gl_y);
}
public boolean canRenderAsync() {
return true;
}
public void render() {
renderer.display(this.gl);
}
}
the key step is :
Code Select
Position pos = Position.fromDegrees(0, 20);
double[] matrixArray;
Matrix posMatrix, matrix;
posMatrix = dc.getGlobe().computeSurfaceOrientationAtPosition(// boxPos);
pos.latitude, pos.longitude, -D3Man.surfaceElevation);//
matrix = dc.getView().getProjectionMatrix().multiply(posMatrix);
matrixArray = new double[16];
matrix.toArray(matrixArray, 0, false);
gl.glMatrixMode(GL2.GL_PROJECTION);
gl.glLoadMatrixd(matrixArray, 0);
matrix = dc.getView().getModelviewMatrix().multiply(posMatrix);
matrixArray = new double[16];
matrix.toArray(matrixArray, 0, false);
gl.glMatrixMode(GL2.GL_MODELVIEW);
gl.glLoadMatrixd(matrixArray, 0);
I set the local coord as in cube demo, and adjust the projection/modelview matrix.
The source code JOGLRenderer.java is a bit long, so i list the commented codes:
Code Select
public void render() {
if (disposed)
return;
Texture2DLoaderJOGL.clearAnimatedTextureTable(globalGL);
if (thePeerRoot == null || theViewer.getSceneRoot() != thePeerRoot
.getOriginalComponent()) {
setSceneRoot(theViewer.getSceneRoot());
thePeerRoot = ConstructPeerGraphVisitor
.constructPeerForSceneGraphComponent(theRoot, null, this);
}
if (auxiliaryRoot != null && thePeerAuxilliaryRoot == null)
thePeerAuxilliaryRoot = ConstructPeerGraphVisitor
.constructPeerForSceneGraphComponent(auxiliaryRoot, null,
this);
renderingState.oneTexture2DPerImage = topAp.isOneTexture2DPerImage();
renderingState.currentPath.clear();
renderingState.context = new Graphics3D(getCameraPath(),
renderingState.currentPath,
CameraUtility.getAspectRatio(theViewer));
//FIXME berg, no reset and background
// globalGL.glMatrixMode(GL2.GL_PROJECTION);
// globalGL.glLoadIdentity();//重置当前指定的矩阵为单位矩阵.
// JOGLRendererHelper.handleBackground(this, width, height,
// theRoot.getAppearance());
frontBanana = true;
renderOnePass();
if (topAp.isRenderSpherical()) {
frontBanana = false;
renderOnePass();
}
if (topAp.isForceResidentTextures())
forceResidentTextures();
}
private void renderOnePass() {
if (theCamera == null)
return;
// double aspectRatio = getAspectRatio();
// System.err.println("aspect ratio = "+aspectRatio);
// for pick mode the aspect ratio has to be set to that of the viewer
// component
//FIXME berg, no reset
// globalGL.glMatrixMode(GL2.GL_PROJECTION);
// globalGL.glLoadIdentity();
// if (topAp.isRenderSpherical()) {
// //把m指定的16个值作为一个矩阵,与当前矩阵相乘,并把结果存储在当前矩阵中,按行主序
// globalGL.glMultTransposeMatrixd(
// frontBanana ? frontZBuffer : backZBuffer, 0);
// // System.err.println("c2ndc = "+Rn.matrixToString(
// // Rn.times(null, frontBanana ? frontZBuffer : backZBuffer,
// // c2ndc)));
// }
// Rectangle2D viewPort = CameraUtility.getViewport(theCamera,
// aspectRatio);
// System.err.println("Camera viewport = "+viewPort.toString());
//FIXME berg, no camera tranform
// double[] c2ndc = CameraUtility.getCameraToNDC(theCamera,
// getAspectRatio(), whichEye);
// // System.err.println("C2ndc = "+Rn.matrixToString(c2ndc));
// globalGL.glMultTransposeMatrixd(c2ndc, 0);
//FIXME berg, no reset
// prepare for rendering the geometry
// globalGL.glMatrixMode(GL2.GL_MODELVIEW);
// globalGL.glLoadIdentity();
// renderingState.cameraToWorld = renderingState.context
// .getCameraToWorld();
// renderingState.worldToCamera = Rn.inverse(null,
// renderingState.cameraToWorld);
//FIXME berg, no reset
// renderingState.cameraToNDC = c2ndc;
// globalGL.glMultTransposeMatrixd(renderingState.worldToCamera, 0);
// if (topAp.getSkyboxCubemap() != null)
// JOGLSkyBox.render(globalGL, renderingState.worldToCamera,
// topAp.getSkyboxCubemap(),
// CameraUtility.getCamera(theViewer));
processLights();
processClippingPlanes();
rhStack.clear();
rhStack.push(RenderingHintsInfo.defaultRHInfo);
RenderingHintsInfo.defaultRHInfo.render(renderingState, null);
renderingState.flipNormals = (Rn
.determinant(renderingState.worldToCamera) < 0.0);
globalGL.glFrontFace(renderingState.flipNormals ? GL.GL_CW : GL.GL_CCW);
texResident = true;
renderPeerRoot();
if (thePeerAuxilliaryRoot != null)
thePeerAuxilliaryRoot.render();
if (topAp.isRenderSpherical() && !frontBanana)
globalGL.glPopMatrix();
//FIXME berg, no reset
// globalGL.glLoadIdentity();
}
The listed two method do the drawing works.
Then, i tried to use the same key step in jPCTLayer, but failed.
The output is:
Code Select
Loading Texture...from InputStream
Loading file from InputStream
File from InputStream loaded...21824 bytes
Processing new material PolyShip_UnWrap!
Texture named POLYSHBP.JPG added to TextureManager!
Processing new material -- default --!
Processing object from 3DS-file: SpaceFight
Object 'SpaceFight_jPCT0' created using 500 polygons and 259 vertices.
1DEBUG[[org.aoe.det.rsshell.ScriptShell.getScriptEngine()]: Use language beanshellx
[ Wed Sep 16 08:50:32 CST 2015 ] - WARNING: There's a problem with the object list not being consistent during rendering. This is often caused by concurrent modification of jPCT objects on a thread different from the rendering thread!
[ Wed Sep 16 08:50:32 CST 2015 ] - ERROR: null
九月 16, 2015 8:50:32 上午 gov.nasa.worldwind.AbstractSceneController draw
严重: Exception while rendering layer org.aoe.det.ww.d3man.ww.Jpct3DLayer
java.lang.NullPointerException
at com.threed.jpct.World.draw(World.java:2091)
at com.threed.jpct.World.draw(World.java:2073)
at com.threed.jpct.World.draw(World.java:1613)
at org.aoe.det.ww.d3man.ww.Jpct3DLayer.repaint(Jpct3DLayer.java:352)
at org.aoe.det.ww.d3man.ww.Jpct3DLayer.doRender(Jpct3DLayer.java:204)
at gov.nasa.worldwind.layers.AbstractLayer.render(AbstractLayer.java:232)
at gov.nasa.worldwind.AbstractSceneController.draw(AbstractSceneController.java:864)
at gov.nasa.worldwind.StereoOptionSceneController.draw(StereoOptionSceneController.java:153)
at gov.nasa.worldwind.BasicSceneController.doNormalRepaint(BasicSceneController.java:42)
at gov.nasa.worldwind.BasicSceneController.doRepaint(BasicSceneController.java:28)
at gov.nasa.worldwind.AbstractSceneController.repaint(AbstractSceneController.java:381)
at gov.nasa.worldwind.WorldWindowGLAutoDrawable.doDisplay(WorldWindowGLAutoDrawable.java:472)
at gov.nasa.worldwind.WorldWindowGLAutoDrawable.display(WorldWindowGLAutoDrawable.java:343)
at jogamp.opengl.GLDrawableHelper.displayImpl(GLDrawableHelper.java:665)
at jogamp.opengl.GLDrawableHelper.display(GLDrawableHelper.java:649)
at javax.media.opengl.awt.GLCanvas$10.run(GLCanvas.java:1289)
at jogamp.opengl.GLDrawableHelper.invokeGLImpl(GLDrawableHelper.java:1119)
at jogamp.opengl.GLDrawableHelper.invokeGL(GLDrawableHelper.java:994)
at javax.media.opengl.awt.GLCanvas$11.run(GLCanvas.java:1300)
at javax.media.opengl.Threading.invoke(Threading.java:193)
at javax.media.opengl.awt.GLCanvas.display(GLCanvas.java:541)
at javax.media.opengl.awt.GLCanvas.paint(GLCanvas.java:595)
at sun.awt.RepaintArea.paintComponent(RepaintArea.java:264)
at sun.awt.RepaintArea.paint(RepaintArea.java:240)
at sun.awt.windows.WComponentPeer.handleEvent(WComponentPeer.java:358)
at java.awt.Component.dispatchEventImpl(Component.java:4957)
at java.awt.Component.dispatchEvent(Component.java:4703)
at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:758)
at java.awt.EventQueue.access$500(EventQueue.java:97)
at java.awt.EventQueue$3.run(EventQueue.java:709)
at java.awt.EventQueue$3.run(EventQueue.java:703)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.ProtectionDomain$1.doIntersectionPrivilege(ProtectionDomain.java:75)
at java.security.ProtectionDomain$1.doIntersectionPrivilege(ProtectionDomain.java:86)
at java.awt.EventQueue$4.run(EventQueue.java:731)
at java.awt.EventQueue$4.run(EventQueue.java:729)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.ProtectionDomain$1.doIntersectionPrivilege(ProtectionDomain.java:75)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:728)
at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:201)
at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:116)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:105)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:101)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:93)
at java.awt.EventDispatchThread.run(EventDispatchThread.java:82)
[ Wed Sep 16 08:50:32 CST 2015 ] - WARNING: There's a problem with the object list not being consistent during rendering. This is often caused by concurrent modification of jPCT objects on a thread different from the rendering thread!
[ Wed Sep 16 08:50:32 CST 2015 ] - ERROR: null
九月 16, 2015 8:50:32 上午 gov.nasa.worldwind.AbstractSceneController draw
严重: Exception while rendering layer org.aoe.det.ww.d3man.ww.Jpct3DLayer
java.lang.NullPointerException
at com.threed.jpct.World.draw(World.java:2091)
at com.threed.jpct.World.draw(World.java:2073)
at com.threed.jpct.World.draw(World.java:1613)
at org.aoe.det.ww.d3man.ww.Jpct3DLayer.repaint(Jpct3DLayer.java:352)
at org.aoe.det.ww.d3man.ww.Jpct3DLayer.doRender(Jpct3DLayer.java:204)
at gov.nasa.worldwind.layers.AbstractLayer.render(AbstractLayer.java:232)
at gov.nasa.worldwind.AbstractSceneController.draw(AbstractSceneController.java:864)
at gov.nasa.worldwind.StereoOptionSceneController.draw(StereoOptionSceneController.java:153)
at gov.nasa.worldwind.BasicSceneController.doNormalRepaint(BasicSceneController.java:42)
at gov.nasa.worldwind.BasicSceneController.doRepaint(BasicSceneController.java:28)
at gov.nasa.worldwind.AbstractSceneController.repaint(AbstractSceneController.java:381)
at gov.nasa.worldwind.WorldWindowGLAutoDrawable.doDisplay(WorldWindowGLAutoDrawable.java:472)
at gov.nasa.worldwind.WorldWindowGLAutoDrawable.display(WorldWindowGLAutoDrawable.java:343)
at jogamp.opengl.GLDrawableHelper.displayImpl(GLDrawableHelper.java:665)
at jogamp.opengl.GLDrawableHelper.display(GLDrawableHelper.java:649)
at javax.media.opengl.awt.GLCanvas$10.run(GLCanvas.java:1289)
at jogamp.opengl.GLDrawableHelper.invokeGLImpl(GLDrawableHelper.java:1119)
at jogamp.opengl.GLDrawableHelper.invokeGL(GLDrawableHelper.java:994)
at javax.media.opengl.awt.GLCanvas$11.run(GLCanvas.java:1300)
at javax.media.opengl.Threading.invoke(Threading.java:193)
at javax.media.opengl.awt.GLCanvas.display(GLCanvas.java:541)
at javax.media.opengl.awt.GLCanvas.paint(GLCanvas.java:595)
at javax.media.opengl.awt.GLCanvas.update(GLCanvas.java:795)
at sun.awt.RepaintArea.updateComponent(RepaintArea.java:255)
at sun.awt.RepaintArea.paint(RepaintArea.java:232)
at sun.awt.windows.WComponentPeer.handleEvent(WComponentPeer.java:358)
at java.awt.Component.dispatchEventImpl(Component.java:4957)
at java.awt.Component.dispatchEvent(Component.java:4703)
at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:758)
at java.awt.EventQueue.access$500(EventQueue.java:97)
at java.awt.EventQueue$3.run(EventQueue.java:709)
at java.awt.EventQueue$3.run(EventQueue.java:703)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.ProtectionDomain$1.doIntersectionPrivilege(ProtectionDomain.java:75)
at java.security.ProtectionDomain$1.doIntersectionPrivilege(ProtectionDomain.java:86)
at java.awt.EventQueue$4.run(EventQueue.java:731)
at java.awt.EventQueue$4.run(EventQueue.java:729)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.ProtectionDomain$1.doIntersectionPrivilege(ProtectionDomain.java:75)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:728)
at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:201)
at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:116)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:105)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:101)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:93)
at java.awt.EventDispatchThread.run(EventDispatchThread.java:82)
[ Wed Sep 16 08:50:33 CST 2015 ] - WARNING: There's a problem with the object list not being consistent during rendering. This is often caused by concurrent modification of jPCT objects on a thread different from the rendering thread!
[ Wed Sep 16 08:50:33 CST 2015 ] - ERROR: null
Without source code, i do not know what is going on and what goes wrong.
I can only guess that something is not initialized or entitled a wrong value.