Hello,
as a clomplete newbie in jogl I write this code but genlist always return a 0
Triangle t = null;
float c1 =1f;
float c2 =0f;
float c3 =0f;
float a =(float)width/2;
float b =(float)height/2;
float c =(float)depth/2;
mcList = gl.glGenLists(1);
System.out.println("numero de liste : "+ mcList);
gl.glNewList(mcList,gl.GL_COMPILE);
gl.glBegin(GL.GL_TRIANGLES); // display all triangle of the mesh
for(Enumeration e =myTriangleMesh.elements(); e.hasMoreElements(); )
{
t=(Triangle)e.nextElement();
float [][] coordsTmp= t.getCoords();
float [][] normsTmp= t.getNorms();
gl.glColor4f(c2,c3,c1,0.25f);
//sommet 1
gl.glNormal3f(normsTmp[0][0],normsTmp[0][1],normsTmp[0][2]);
gl.glVertex3f(coordsTmp[0][0]-a,coordsTmp[0][1]-b,coordsTmp[0][2]-c);
//sommet 2
gl.glNormal3f(normsTmp[1][0],normsTmp[1][1],normsTmp[1][2]);
gl.glVertex3f(coordsTmp[1][0]-a,coordsTmp[1][1]-b,coordsTmp[1][2]-c);
// sommet 3
gl.glNormal3f(normsTmp[2][0],normsTmp[2][1],normsTmp[2][2]);
gl.glVertex3f(coordsTmp[2][0]-a,coordsTmp[2][1]-b,coordsTmp[2][2]-c);
}
gl.glEnd();
gl.glEndList();
System.out.println("liste d'affichage OK");
I don’t understand why ?
\thx for help
Cook
ps : scuse my poor english