import { vec3 } from 'gl-matrix' ; export class Face { public static verticesCount : number = 3 ; public verticesIndices : number [ ] ; constructor ( vertexAIndex , vertexBIndex , vertexCIndex ) { this . verticesIndices = [ vertexAIndex , vertexBIndex , vertexCIndex ] ; } public static computeFaceNormal ( a , b , c ) { const ab = vec3 . create ( ) ; const ac = vec3 . create ( ) ; vec3 . subtract ( ab , b , a ) ; vec3 . subtract ( ac , c , a ) ; const normal = vec3 . create ( ) ; vec3 . cross ( normal , ab , ac ) ; vec3 . normalize ( normal , normal ) ; return normal ; } }