With the new utility.geometry package I would like to use a GeometryCreator (let’s call it gec) to create a model, which I then feed to XithGeometryInfo (let’s call it xgi).
Two questions…
a) How does xgi.recalculateSmoothGroupNormals() work in english (*) ?
Does it take all the faces with the same smooth group number (which has been set per setFaceSmoothingGroup) and avarage the normal vector of adjacent faces?
Or does it avarage just all the face’s vectors in the same smooth group?
For example:
http://mitglied.lycos.de/nautis/Publik/Cone.png
Face0 is in an own smooth group, whereas Face1…FaceN are in a second smooth group. This would work fine, then? Does adjacent mean: Face0 is adjacent to Face1 but not to Face2, even when the top most vertex (the Cone’s top) is being shared?
(Edit: of course Face0 would have to consist of many triangles, but in the end it’s the same question.)
b) Instead of using smooth groups I’d like to define a maximum angle between adjacent polygons that will be smooth shaded. Shading across edges at higher angles shouldn’t be interpolated (the polygons will appear to meet at a sharp seam).
I think there’s no such possibility in Xith3d currently, so I would have to use smooth groups anway? So… find out “somehow” all adjacent faces with an angle between them being below the crease value. Then set all these faces to the same smoothgroup. Then use the recalculateSmoothGroupNormals() method.
Would this work-around do the trick?
(*) I know there’s the source code but … I’m very bad in understanding other people’s source…
