public GeomPrimitive()
 {
     shader = null;
 }
 public void setShader(Shader _shader)
 {
     shader = _shader;
 }
        public void compileMeshToScene(Scene scene, Shader shader)
        {
            int faceID = 0;
            for (int i = 0; i < numFaces * m_vertsPerFace; i += m_vertsPerFace) {

                Triangle tri = new Triangle();
                tri.v[0].set(v[ f[i+0] ]);
                tri.v[1].set(v[ f[i+1] ]);
                tri.v[2].set(v[ f[i+2] ]);

                tri.tc[0].set(tc[i + 0]);
                tri.tc[1].set(tc[i + 1]);
                tri.tc[2].set(tc[i + 2]);

                tri.vn[0].set(vn[i + 0]);
                tri.vn[1].set(vn[i + 1]);
                tri.vn[2].set(vn[i + 2]);

                tri.shaderID = faceShaderIDs[faceID];

                tri.setShader(shader);
                scene.addPrimitive(tri);

                faceID++;
            }
        }