Update of /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/view
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv8455/src/net/sourceforge/bprocessor/gl/view
Modified Files:
AbstractView.java
Log Message:
Uses glPolygonOffset to solve som z-fighting issues:
- The edge-lines are visible
- The green highligt does not mix with the original surface
Index: AbstractView.java
===================================================================
RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/view/AbstractView.java,v
retrieving revision 1.44
retrieving revision 1.45
diff -C2 -d -r1.44 -r1.45
*** AbstractView.java 24 Oct 2005 10:27:28 -0000 1.44
--- AbstractView.java 26 Oct 2005 10:15:05 -0000 1.45
***************
*** 254,257 ****
--- 254,258 ----
gl.glLineWidth(3.0f);
gl.glEnable(GL.GL_DEPTH_TEST);
+ gl.glDepthFunc(GL.GL_LESS);
coords();
***************
*** 265,269 ****
gl.glColor3fv(STD_LINE_COLOR);
! gl.glLineWidth(2.0f);
drawAll(gld);
--- 266,270 ----
gl.glColor3fv(STD_LINE_COLOR);
! gl.glLineWidth(3.0f);
drawAll(gld);
***************
*** 623,626 ****
--- 624,633 ----
}
+
+ if (drawMode == LIGHTING_MODE) {
+ gl.glEnable(GL.GL_LIGHTING);
+ }
+
+ gl.glLineWidth(1.0f);
// draw all the edges in the model
if (drawMode != LIGHTING_MODE) {
***************
*** 631,638 ****
drawEdge(e);
}
- } else {
- gl.glEnable(GL.GL_LIGHTING);
}
!
// draw all the surfaces in the model
if (drawMode != WIREFRAME_MODE) {
--- 638,645 ----
drawEdge(e);
}
}
! gl.glEnable(GL.GL_POLYGON_OFFSET_FILL);
! gl.glPolygonOffset(1.0f, 1.0f);
! gl.glPolygonMode(GL.GL_FRONT_AND_BACK, GL.GL_FILL);
// draw all the surfaces in the model
if (drawMode != WIREFRAME_MODE) {
***************
*** 654,657 ****
--- 661,665 ----
}
}
+ gl.glDisable(GL.GL_POLYGON_OFFSET_FILL);
} else {
|