Hello everyone!
I want to load an obj file with opengl which shows a bezier curve.
I know how to load the v, vt, f.
The if-query for the “v” looks like this:
if(prefix.compare("v")==0)
{
line = line.substr(line.find_first_of("v")+2);
Vertex v;
istringstream s(line);
s>>v.x;
s>>v.y;
s>>v.z;
if(v.x<min[0])
min[0] = v.x;
if(v.y<min[1])
min[1] = v.y;
if(v.z<min[2])
min[2] = v.z;
if(v.x>max[0])
max[0] = v.x;
if(v.y>max[1])
max[1] = v.y;
if(v.z>max[2])
max[2] = v.z;
mesh.vertices.push_back(v);
}
But how can I make the If- Query to load the ctype, deg and curve?
I only have this so far:
if (prefix.compare("deg")==0)
{
line = line.substr(line.find_first_of("deg")+1);// deg +1;
}
if (prefix.compare("curve")==0)
{
// curve
}
here is an example obj File Bezier curve
v 0.0 0.0 0.0
v 0.0 1.0 0.0
v 1.0 1.0 0.0
v 1.0 0.0 0.0
cstype bezier
deg 3
curv 1 2 3 4
end