ccdemos/common_ply.h
branchpyrit
changeset 72 7c3f38dff082
parent 69 303583d2fb97
child 80 907929fa9b59
equal deleted inserted replaced
71:4fedf7290929 72:7c3f38dff082
    56 			printf("ply error: faces of %d vertices not supported", num);
    56 			printf("ply error: faces of %d vertices not supported", num);
    57 			continue;
    57 			continue;
    58 		}
    58 		}
    59 		f >> v1 >> v2 >> v3;
    59 		f >> v1 >> v2 >> v3;
    60 		face = new Triangle(vertices.at(v1), vertices.at(v3), vertices.at(v2), mat);
    60 		face = new Triangle(vertices.at(v1), vertices.at(v3), vertices.at(v2), mat);
    61 		rt.addshape(face);
    61 		rt.addShape(face);
    62 
    62 
    63 		normals.at(v1) += face->getNormal();
    63 		normals.at(v1) += face->getNormal();
    64 		vertex_face_num.at(v1)++;
    64 		vertex_face_num.at(v1)++;
    65 		normals.at(v2) += face->getNormal();
    65 		normals.at(v2) += face->getNormal();
    66 		vertex_face_num.at(v2)++;
    66 		vertex_face_num.at(v2)++;