i’m making blender model loader for 3d engine,
trying to convert specific lines with floats in it,
ex: (v 1.000000 -1.000000 1.000000),
I try to convert the numbers in file(string) to floats with std::stod() but it doesn’t work,
here’s code:
void mesh::load(fstream &file) // file not important for error
{
string line = "v 1.000000";
string n = ""; // substring of search()
n.resize(34);
int st = 2; // starting index
search(line, ' ', st); // makes a substring that end at ' ' or end of string
// put code to convert n to float
/*
while (getline(file,line))
{
switch (line.at(0))
{
case 'v':
cout << "n";
}
}
*/
}
New contributor
samone123 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.