Generating vertex normals for smooth shading with crease angle in Three.js

淺唱寂寞╮ 提交于 2019-12-10 13:46:35

问题


I have several objects in Three.js's JSON Model Format. It specifies vertex positions, and faces -- sometimes triangles, sometimes quads, sometimes with material indices and sometimes not.

However none of these files have vertex normals specified.

I want an algorithm that can calculate such normals over a set of mesh faces. I'd like to specify an angular limit beyond which a crease is shown (normals are not shared by adjacent faces at a vertex.)

Before coding this myself I wondered, does this exist either in Three.js already or somewhere else that's usable?


回答1:


The only thing available is

geometry.computeFaceNormals();
geometry.computeVertexNormals();

See the source for the algorithm.

three.js r.55



来源:https://stackoverflow.com/questions/14762889/generating-vertex-normals-for-smooth-shading-with-crease-angle-in-three-js

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!