7 ms·
three.js removed support for quads to reduce renderer complexity. https://github.com/mrdoob/three.js/blob/master/src/core/Face4.js https://github.com/mrdoob/th
by razh 12y ago
three.js removed support for quads to reduce renderer complexity.
https://github.com/mrdoob/three.js/blob/master/src/core/Face4.js https://github.com/mrdoob/three.js/blob/master/src/core/Face...
https://github.com/mrdoob/three.js/blob/88092284cbe07723fe2bd677ee594faf948521d4/src/renderers/CanvasRenderer.js#L836 https://github.com/mrdoob/three.js/blob/88092284cbe07723fe2b...
And the relevant issue:
https://github.com/mrdoob/three.js/issues/3663 https://github.com/mrdoob/three.js/issues/3663
- mbrubeck 12y agoEven before that change, I don't see any code that automatically reconstructs construct quads from pairs of triangles. But maybe I'm missing something?
- razh 12y agoNo, you're right, there's no quad reconstruction. I imagine you could have just used quads in both the WebGL and Canvas renderers to achieve a similar effect.
- lunixbochs 12y ago(I've been working on OpenGL platform translation for years) Reconstructing quads from pairs of triangles is just about doable in a one-liner. The harder part in my opinion is applying texture mapping to the resulting triangle, but it's not unreasonably difficult. // this depends on your winding triangles = [1, 2, 4, 2, 3, 4] quads = [] for i in xrange(len(triangles), 6): t = triangles[i:i+6] quads += [t[0], t[1], t[4], t[2]] The only things I think are interesting here are their heuristics on shaders to apply color maps, and the fact they shipped a game with it.