tim.ebbinghaus
04-23-2008, 04:04 PM
Hi folks,
im developing a swing based application which makes use of the WWJ-Component (which is btw a great piece of software - thanks so far!).
The Component is used as some kind of "live-screensaver" which displays a slow rotating globe - Works perfectly...
BUT, my interface designer wants the globe to be shifted to the lower left corner. I achieved this by implementing a custom SceneController which calls glTranslate in order to translate the viewport (code below)...
Im using some guessed values for the matrix because i havent done anything with opengl before (so maybe there are far more reasonable values to achieve this?!)...
the overridden doRepaint method of the SceneController looks like this:
protected void doRepaint(DrawContext dc) {
GL gl = dc.getGL();
this.initializeFrame(dc);
try {
this.applyView(dc);
this.createTerrain(dc);
this.clearFrame(dc);
this.pick(dc);
this.clearFrame(dc);
gl.glTranslatef(-3000000.0f, -1800000f, -1000000);
this.draw(dc);
} finally {
this.finalizeFrame(dc);
}
}
My problem: the renderer seems to use a smaller viewport than the real one. While rotating, the renderer "misses" to render some polygons on the upper and the right side of the globe. (as seen on the image)
http://swap.dosenpils.de/screen.png
As time goes by (and the globe rotates...), the missed polygons get rendered correctly but new missed polygons appear on the horizon. (the whole globe gets rendered perfectly if zoomed out)
I turned backface culling off and on but this did not change anything..
Same effect on MacOSX 10.5.2 and Windows XP...
Have you any idea how to solve this problem or achieving the "shift" effect in a different way?
Thanks so far & regards
Tim Ebbinghaus
im developing a swing based application which makes use of the WWJ-Component (which is btw a great piece of software - thanks so far!).
The Component is used as some kind of "live-screensaver" which displays a slow rotating globe - Works perfectly...
BUT, my interface designer wants the globe to be shifted to the lower left corner. I achieved this by implementing a custom SceneController which calls glTranslate in order to translate the viewport (code below)...
Im using some guessed values for the matrix because i havent done anything with opengl before (so maybe there are far more reasonable values to achieve this?!)...
the overridden doRepaint method of the SceneController looks like this:
protected void doRepaint(DrawContext dc) {
GL gl = dc.getGL();
this.initializeFrame(dc);
try {
this.applyView(dc);
this.createTerrain(dc);
this.clearFrame(dc);
this.pick(dc);
this.clearFrame(dc);
gl.glTranslatef(-3000000.0f, -1800000f, -1000000);
this.draw(dc);
} finally {
this.finalizeFrame(dc);
}
}
My problem: the renderer seems to use a smaller viewport than the real one. While rotating, the renderer "misses" to render some polygons on the upper and the right side of the globe. (as seen on the image)
http://swap.dosenpils.de/screen.png
As time goes by (and the globe rotates...), the missed polygons get rendered correctly but new missed polygons appear on the horizon. (the whole globe gets rendered perfectly if zoomed out)
I turned backface culling off and on but this did not change anything..
Same effect on MacOSX 10.5.2 and Windows XP...
Have you any idea how to solve this problem or achieving the "shift" effect in a different way?
Thanks so far & regards
Tim Ebbinghaus