Update of /cvsroot/bprocessor//gl/src/net/sourceforge/bprocessor/gl/view
In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv29426/src/net/sourceforge/bprocessor/gl/view
Modified Files:
Display.java
Log Message:
Made display use normals properly
Index: Display.java
===================================================================
RCS file: /cvsroot/bprocessor//gl/src/net/sourceforge/bprocessor/gl/view/Display.java,v
retrieving revision 1.39
retrieving revision 1.40
diff -C2 -d -r1.39 -r1.40
*** Display.java 23 Oct 2007 07:20:44 -0000 1.39
--- Display.java 23 Oct 2007 13:13:36 -0000 1.40
***************
*** 112,116 ****
glu.gluTessProperty(tesselator, GLU.GLU_TESS_WINDING_RULE, GLU.GLU_TESS_WINDING_ODD);
-
byte b1 = (byte) 0x88;
byte b2 = (byte) 0x22;
--- 112,115 ----
***************
*** 191,195 ****
public void vertex(Object object) {
double[] vertex = (double[]) object;
! gl.glNormal3dv(vertex, 3);
gl.glVertex3dv(vertex, 0);
}
--- 190,196 ----
public void vertex(Object object) {
double[] vertex = (double[]) object;
! if (vertex.length >= 6) {
! gl.glNormal3dv(vertex, 3);
! }
gl.glVertex3dv(vertex, 0);
}
***************
*** 527,533 ****
Vertex normal = surface.normal();
for (Vertex current : vertices) {
! double[] content = new double[6];
if (normals != null) {
normal = normals.get(index % normals.size());
if (reverse) {
content[3] = -normal.getX();
--- 528,535 ----
Vertex normal = surface.normal();
for (Vertex current : vertices) {
! double[] content = null;
if (normals != null) {
normal = normals.get(index % normals.size());
+ content = new double[6];
if (reverse) {
content[3] = -normal.getX();
***************
*** 542,548 ****
}
}
! content[0] = current.getX();
! content[1] = current.getY();
! content[2] = current.getZ();
glu.gluTessVertex(tesselator, content, 0, content);
}
--- 544,554 ----
}
}
! if (content == null) {
! content = current.values();
! } else {
! content[0] = current.getX();
! content[1] = current.getY();
! content[2] = current.getZ();
! }
glu.gluTessVertex(tesselator, content, 0, content);
}
|