how to parsing file in this form my file is looks like this
v -1.000000 -1.000000 -1.000000
v -1.000000 1.000000 -1.000000
vn 1.0000 0.0000 0.0000
vn 0.0000 0.0000 1.0000
f 2//1 3//1 1//1
f 4//2 7//2 3//2
and my parsing code here:
ifstream fin;
string reader;
while(fin>>reader)
{
if(reader == "v"){
vec3 vertex;
fin>>vertex.x>>vertex.y>>vertex.z;
out_vertices.push_back(vertex);
} else if(reader == "vn"){
vec3 normal;
fin>>normal.x>>normal.y>>normal.z;
out_normals.push_back(normal);
}else if(reader== "f"){
vec2 facet;
vec3 _normal,_vertex;
fin>>_vertex.x>>_vertex.y>>_vertex.z >>_normal.x>>_normal.y>>_normal.z;
facet.normal = _normal;
facet.vetex = _vertex;
out_facets.push_back(facet);
}
}
how ever it can't reading the line start with f? is there any good way to do that ?