Hi !
Featured games (90)
games approved by the League of Dukes
Games in Showcase (711)
Games in Android Showcase (213)
games submitted by our members
Games in WIP (785)
games currently in development
News: Read the Java Gaming Resources, or peek at the official Java tutorials
   Home   Help   Search   Login   Register   
  Show Posts
Pages: [1]
1  Java Game APIs & Engines / JOGL Development / GLU tesselation problem on: 2004-06-12 20:29:48

I hope someone can help me out. I added GLU tesselation for complex polygons to my renderer,
but it does not work for all cases.
It works for complex non-intersecting polygons,
I tried it with a VMAP0 data set - country boundaries for european states with 100k+ vertices. But once I try to tesselate this simple self-intersecting polygon:

0,0, 100,100, 0,100, 100,0

I get a complaint that the combine callback is not defined. Which is funny because this callback is called right before the error callback and it holds the correct new vertex position.

Also the begin, vertex and end callbacks are apparently not called at all...

I boiled this down into the following code, what am I doing wrong here?

private void drawTesselPoly(GL gl, GLU glu) {
   if( this.tesselator == null)
       tesselator = glu.gluNewTess();                  
       glu.gluTessCallback(this.tesselator, GLU.GLU_TESS_VERTEX, this);
                 glu.gluTessCallback(this.tesselator, GLU.GLU_TESS_VERTEX_DATA, this);
                 glu.gluTessCallback(this.tesselator, GLU.GLU_TESS_BEGIN, this);
                 glu.gluTessCallback(this.tesselator, GLU.GLU_TESS_END, this);
                 glu.gluTessCallback(this.tesselator, GLU.GLU_TESS_ERROR, this);
                 glu.gluTessCallback(this.tesselator, GLU.GLU_TESS_COMBINE, this);
                 glu.gluTessCallback(this.tesselator, GLU.GLU_TESS_COMBINE_DATA, this);                  
           glu.gluTessProperty(this.tesselator, GLU.GLU_TESS_WINDING_RULE, GLU.GLU_TESS_WINDING_NONZERO);            
           TessPoint3D vertex1 = new TessPoint3D(0.0,0.0,0.0);
           glu.gluTessBeginPolygon( tesselator, vertex1);        

           glu.gluTessVertex(tesselator, new double[]{0, 0, 0} , new TessPoint3D(0, 0, 0));
           glu.gluTessVertex(tesselator, new double[]{100, 100, 0} , new TessPoint3D(100,100,0));
           glu.gluTessVertex(tesselator, new double[]{0, 100, 0} , new TessPoint3D(0,100,0));
           glu.gluTessVertex(tesselator, new double[]{100, 0, 0} , new TessPoint3D(100,0,0));

I defined the callbacks in my renderer class (which implements the
GLUtesselatorCallback) like this:

     public void begin(int arg0) {      
           gl.glBegin( arg0);      
     public void beginData(int arg0, Object arg1) {
           gl.glBegin( arg0);            
     public void vertex(Object arg0) {      
           TessPoint3D tessp = (TessPoint3D)arg0;      
           gl.glVertex3d( tessp.x, tessp.y, tessp.z);

     public void vertexData(Object arg0, Object arg1) {            
           TessPoint3D tessp = (TessPoint3D)arg0;
           gl.glVertex3d( tessp.x, tessp.y, tessp.z);      
     public void end() {
     public void endData(Object arg0) {
     public void combine(double[] arg0, Object[] arg1, float[] arg2, Object[] arg3) {
     public void combineData(double[] arg0, Object[] arg1, float[] arg2, Object[] arg3, Object arg4) {
     public void error(int arg0) {
           System.out.println("tess error: "+glu.gluErrorString(arg0));
     public void errorData(int arg0, Object arg1) {
           System.out.println("tess errorData: "+glu.gluErrorString(arg0));            

TessPoint is a small private class:

     private class TessPoint3D
           public double x;
           public double y;
           public double z;
           public TessPoint3D(double p1, double p2, double p3) {
                 x = p1; y = p2; z = p3;

Best regards,

2  Java Game APIs & Engines / Java 2D / Re: JDK 1.5.0-beta2 is now available on: 2004-05-28 14:18:22
Just tested it with my benchmark.
Sadly the performance is much worse than plain
Java2D (10x slower and worse).   :-/
I am using a Quadro4 750 under Win XP. Upgrading
the driver from 45.23 to 56.72 did not speed things
up. I feel as if its not hardware accelerated at all...

3  Java Game APIs & Engines / JOGL Development / Re: What are people doing with JOGL? on: 2004-03-19 17:38:21
JOGL is used for the 3D visualisation of meteorological data in this project:

It will also be an alternative to Java2D for the rendering of 2D content.
4  Java Game APIs & Engines / JOGL Development / Re: JOGL & J2D Combined Superpower! on: 2003-09-27 17:28:18

I encountered similar issues during my work on a project that uses a scenegraph implementation which can be displayed using Java2D, Java3D or OpenGL via GL4Java (and soon JOGL). Because the focus is now mainly on displaying compex 2D scenes (geographical data as raster images and vector data and overlayed meteorological data in all kind of flavours) Java2D is the renderer used by default. The OpenGL path currently has only rudimentary text functionality and has bad performance if complex polygons have to be triangulated prior to their use.
To speed things up I experimented with drawing the Java2D path into a BufferedImage which I used then as a texture. I haven't measured performance yet, but I guess it would be in the area you mentioned (BTW: what is your target platform?) Until now I haven't found a perfect solution to integrate the best features of J2D and OpenGL,  but if I figure something out I'll let you know.


Pages: [1]
numerical (178 views)
2017-02-21 07:32:16

numerical (177 views)
2017-02-21 07:31:46

theagentd (285 views)
2017-02-18 13:42:33

theagentd (286 views)
2017-02-18 13:35:16

h.pernpeintner (1453 views)
2017-01-24 22:39:11

h.pernpeintner (1438 views)
2017-01-24 22:38:32

Galdo (2003 views)
2017-01-12 13:44:09

Archive (2048 views)
2017-01-02 05:31:41

0AndrewShepherd0 (2585 views)
2016-12-16 03:58:39

0AndrewShepherd0 (2332 views)
2016-12-15 21:50:57
List of Learning Resources
by elect
2016-09-09 09:47:55

List of Learning Resources
by elect
2016-09-08 09:47:20

List of Learning Resources
by elect
2016-09-08 09:46:51

List of Learning Resources
by elect
2016-09-08 09:46:27

List of Learning Resources
by elect
2016-09-08 09:45:41

List of Learning Resources
by elect
2016-09-08 08:39:20

List of Learning Resources
by elect
2016-09-08 08:38:19

Rendering resources
by Roquen
2016-08-08 05:55:21 is not responsible for the content posted by its members, including references to external websites, and other references that may or may not have a relation with our primarily gaming and game production oriented community. inquiries and complaints can be sent via email to the info‑account of the company managing the website of java‑
Powered by MySQL Powered by PHP Powered by SMF 1.1.18 | SMF © 2013, Simple Machines | Managed by Enhanced Four Valid XHTML 1.0! Valid CSS!