Welcome! Log In Create A New Profile

smoothing algorithm without quads
avatarAugust 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..
smoothing algorithm without quads Nicola1020August 30, 2013 07:07AM
Re: smoothing algorithm without quads Ben Supnik442August 30, 2013 07:50AM
Re: smoothing algorithm without quads Nicola393August 30, 2013 08:18AM
Re: smoothing algorithm without quads Ben Supnik384August 30, 2013 08:58AM
Re: smoothing algorithm without quads Steffen830August 30, 2013 10:28AM
Re: smoothing algorithm without quads Roland Melkert367August 30, 2013 09:39AM

Sorry, only registered users may post in this forum.

Click here to login