Page 2 of 2

Posted: Wed 29. Apr 2009, 22:24
by Joe
The hint of gunn worked. If I use ...

Code: Select all

IndexedFaceSetUtility.makeConsistentOrientation(ifs);
IndexedFaceSetUtility.calculateAndSetNormals(ifs);
... the representations in JOGL and softviewer look identical (flat and smooth shading).

But to give steffen the possibility to see what I saw, I tried to show it with the ViewerApp.
So I started the ViewerApp webstart application and loaded the toydog.3ds file to create a simple way of demonstrating the problem. But unfortunately I'm not able to activate the smooth shading via navigator. Here is, what I did:
  • * Startet ViewerApp: http://www3.math.tu-berlin.de/jreality/ ... erApp.jnlp
    * Loaded toydog.3ds (link see some posts above)
    * In Navigator: "root", "root appearance", "DefaultGeometryShader": Show only faces
    * Open "DefaultGeometryShader" and activate "smoothShading" in "DefaultPolygonShader".
But the model still flat shaded. What else do I have to do to activate smooth shading via the Navigator?[/code]

Posted: Thu 30. Apr 2009, 18:48
by steffen
Ok, I see, there are no vertex normals in the file, by calling "calculateAndSetVertexNormals" I can reproduce the picture. However, I do not understand what I see...

The mesh needs to have correct combinatorics, otherwise makeConsistentOrientation would not do anything (would just be a bunch of triangles then). But I have no idea how gl can render so different colors at the vertices, it just interpolates the shaded color values at the vertices over the triangle. The vertex normals are more or less zero, so maybe it's just numerical crap (like clamping +-infinity). Charles, any idea what happens there?