DVector3C vec0 = bodies[i][j].getPosition();
DVector3C vec1 = bodies[i + 1][j].getPosition();
DVector3C vec2 = bodies[i][j + 1].getPosition();
DVector3C vec3 = bodies[i + 1][j + 1].getPosition();
DVector3C temp1 = new DVector3(vec1.get0() - vec0.get0(),
vec1.get1() - vec0.get1(), vec1.get2() - vec0.get2());
DVector3C temp2 = new DVector3(vec2.get0() - vec0.get0(),
vec2.get1() - vec0.get1(), vec2.get2() - vec0.get2());
DVector3C temp3 = new DVector3(vec1.get0() - vec2.get0(),
vec1.get1() - vec2.get1(), vec1.get2() - vec2.get2());
DVector3C temp4 = new DVector3(vec3.get0() - vec2.get0(),
vec3.get1() - vec2.get1(), vec3.get2() - vec2.get2());
DVector3C normal = new DVector3(temp1.get1() * temp2.get2()
- temp1.get2() * temp2.get1(), temp1.get2()
* temp2.get0() - temp1.get0() * temp2.get2(),
temp1.get0() * temp2.get1() - temp1.get1()
* temp2.get0());
DVector3C normal2 = new DVector3(temp3.get1() * temp4.get2()
- temp3.get2() * temp4.get1(), temp3.get2()
* temp4.get0() - temp3.get0() * temp4.get2(),
temp3.get0() * temp4.get1() - temp3.get1()
* temp4.get0());
DVector3C norm0 = normal.clone();
DVector3C norm1 = normal.clone();
DVector3C norm2 = normal.clone();
DVector3C norm3 = normal.clone();
norm1 = new DVector3(norm1.get0() + normal2.get0(),
norm1.get1() + normal2.get1(), norm1.get2()
+ normal2.get2());
norm2 = new DVector3(norm2.get0() + normal2.get0(),
norm2.get1() + normal2.get1(), norm2.get2()
+ normal2.get2());
norm3 = new DVector3(norm3.get0() + normal2.get0(),
norm3.get1() + normal2.get1(), norm3.get2()
+ normal2.get2());
GL11.glNormal3d(norm0.get0(), norm0.get1(), norm0.get2());
GL11.glVertex3d(vec0.get0(), vec0.get1(), vec0.get2());
GL11.glNormal3d(norm1.get0(), norm1.get1(), norm1.get2());
GL11.glVertex3d(vec1.get0(), vec1.get1(), vec1.get2());