Welcome! Log In Create A New Profile

Advanced
smoothing algorithm without quads
August 30, 2013 07:07AM
I'm upgrading my webgl renderer program Brigl to work with the latest version of Three.js (the 3d engine i use).
I've found a bitter suprise: they deprecated the Quad primitive (Face4). Now the whole library only deals with triangles (Face3).
I relied to quads for my smoothing algorithm, and everything broke :)

So my algorithm worked like this: if two faces have a conditional line on the common edge, that means the faces should be smoothed. Smoothing means averaging all normals (per-vertex face normals) at each end of the conditional lines.

I've adjusted for the Face4 removal in the simplest way: by adding two Face3 composing the quad. But now it happends that if i have two quad connected by a condline, only two of the four triangles are affected, the other two staying unsmoothed, effectively creating a zigzag pattern. You can see it here:



Do you have any idea on how i could correct this issue? I tried to keep track of triangle pairs forming quads, but i couldn't manage to restore a working solution.
Eventually i could move all smoothing code to BEFORE generating the 3d mesh, that is while still working with plain ldraw objects (quads and tri), but it looks like an huge amount of work..
SubjectAuthorViewsPosted
smoothing algorithm without quads Nicola456August 30, 2013 07:07AM
Re: smoothing algorithm without quads Ben Supnik166August 30, 2013 07:50AM
Re: smoothing algorithm without quads Nicola161August 30, 2013 08:18AM
Re: smoothing algorithm without quads Ben Supnik182August 30, 2013 08:58AM
Re: smoothing algorithm without quads Steffen278August 30, 2013 10:28AM
Re: smoothing algorithm without quads Roland Melkert153August 30, 2013 09:39AM



Sorry, only registered users may post in this forum.

Click here to login