You are right, normals are only considered for lighting, to make a geometry double-sided you have to reverse its winding order.
HTH Wolfgang Kienreich -----Urspr�ngliche Nachricht----- Von: Discussion list for Java 3D API [mailto:[EMAIL PROTECTED]]Im Auftrag von Roland Sarrazin Gesendet: Freitag, 23. August 2002 16:50 An: [EMAIL PROTECTED] Betreff: [JAVA3D] Normals considered when rendering without light? Hello, I have an input geometry, and I want to get a two-sided geometry with a different color per geometry. I do the following: I copy the input geometry, negate its normals and finally set the right color. My question is: Is the normals' direction used at all when rendering without light (i.e. with no material, simply using the vertices' color)? I've got the feeling that it doesn't, since with the following code I can only see the "outside-pointing" geometry, not the inner one. That is, I see only the "green" geometry, never the "red" one. (gi1 and gi2 are GeometryInfo objects containing the considered geometry, without normal information) Color3f green=new Color3f(0f,1f,0f); Color3f red=new Color3f(1f,0f,0f); Color3f[] colors1=new Color3f[coordinates.length]; Color3f[] colors2=new Color3f[coordinates.length]; for(int i=0;i<coordinates.length;i++) { colors1[i]=red; colors2[i]=green; } gi1.setColors(colors1); gi2.setColors(colors2); ng.generateNormals(gi1); ng.generateNormals(gi2); TriangleArray taFirst=(TriangleArray)gi1.getGeometryArray(); TriangleArray taSecond=(TriangleArray)gi2.getGeometryArray(); for(int i=0;i<taFirst.getVertexCount();++i) { Vector3f normal=new Vector3f(); taFirst.getNormal(i,normal); normal.scale(-1f); taFirst.setNormal(i,normal); } Appearance app1=new Appearance(); PolygonAttributes poly1=new PolygonAttributes(); poly1.setPolygonMode(poly1.POLYGON_FILL); poly1.setCullFace(poly1.CULL_BACK); app1.setPolygonAttributes(poly1); Appearance app2=new Appearance(); PolygonAttributes poly2=new PolygonAttributes(); poly2.setPolygonMode(poly2.POLYGON_FILL); poly2.setCullFace(poly2.CULL_BACK); app2.setPolygonAttributes(poly2); Shape3D sh1=new Shape3D(taFirst,app1); Shape3D sh2=new Shape3D(taSecond,app2); BranchGroup result=new BranchGroup(); result.addChild(sh1); result.addChild(sh2); Have you got any idea where my problem is? Thank you! =========================================================================== To unsubscribe, send email to [EMAIL PROTECTED] and include in the body of the message "signoff JAVA3D-INTEREST". For general help, send email to [EMAIL PROTECTED] and include in the body of the message "help". =========================================================================== To unsubscribe, send email to [EMAIL PROTECTED] and include in the body of the message "signoff JAVA3D-INTEREST". For general help, send email to [EMAIL PROTECTED] and include in the body of the message "help".
