From: Braden M. <br...@en...> - 2006-01-31 05:54:28
|
On Mon, 2006-01-30 at 22:17 +0100, Michael Sögtrop wrote: > Hi Braden, > > > > Can you point me to the code where the normals for such things are > > > > calculated? > > > > I think the problem is that they aren't. > > > > openvrml::gl::viewer::insert_shell has a comment in it noting > > that per-vertex normal generation is not implemented. > > I am not an VRML expert, but I would say that these are faces that > have one face normal, rather than per-vertex normals. In other viewers > these faces are rendered as flat faces with all the same color so all > vertices of these faces must have the some normal vector. Are you talking about adjacent polygons that lie fully in the same plane? > Are such per > face normal vectors calculated somewhere? No. Nor is it obvious to me that they should be. I don't understand why per-vertex normal generation wouldn't satisfy your requirement. (But then, perhaps I don't understand the visual effect you're looking for.) This is what the VRML97 spec has to say on the issue (6.23): If the normal field is not NULL, it shall contain a Normal node whose normals are applied to the vertices or faces of the IndexedFaceSet in a manner exactly equivalent to that described above for applying colours to vertices/faces (where normalPerVertex corresponds to colorPerVertex and normalIndex corresponds to colorIndex). If the normal field is NULL, the browser shall automatically generate normals, using creaseAngle to determine if and how normals are smoothed across shared vertices (see 4.6.3.5, Crease angle field). -- Braden McDaniel e-mail: <br...@en...> <http://endoframe.com> Jabber: <br...@ja...> |