That it crashed, and then I saw that you knew the server was down, which is why it's crashing I suppose.
Ya, that was why.
Also, you can check stderr.txt for errors.
Anyway, I completed a basic, single polygon .obj phraser and shower, so I can make complex shapes and display them.
Here's the code, by the way:
/* start model code */
string fstr(float in)
{
stringstream bob;
bob<<in;
return bob.str();
}
struct vec3
{
float x,y,z;
};
class globjfaces
{
public:
int verts,fv;
vec3 vectors[101];
vec3 facevector[101];
void show(int x,int y,int z);
void readin(char *filenam);
globjfaces(){verts = 1;fv = 0;};
};
string v3str(vec3 in)
{
string ret = "";
ret+=fstr(in.x);
ret+=" ";
ret+=fstr(in.y);
ret+=" ";
ret+=fstr(in.z);
return ret;
}
void globjfaces::show(int x,int y,int z)
{
glBegin(GL_POLYGON);
for(int i = 0; i<fv; i++)
{
glVertex3f(x+facevector[i].x, y+facevector[i].y, z+facevector[i].z);
}
glEnd();
}
int numwords(string in)
{
int count = 0;
int offset = 0;
bool goon = true;
while(goon)
{
int pos = in.find(" ",offset);
if(pos != string::npos)
{
count++;
offset = pos+1;
}
else
break;
}
return count+1;
}
string getword(string in,int word)
{
int count = 0;
int offset = 0;
int begw = 0,endw = 0;
bool goon = true;
while(goon)
{
int pos = in.find(" ",offset);
if(pos != string::npos)
{
offset = pos+1;
if(count == word-1)
{
begw = offset-1;
}
if(count == word)
{
endw = offset-1;
break;
}
count++;
}
else
break;
}
return in.substr(begw,endw-begw);
}
void globjfaces::readin(char *filename)
{
string line;
ifstream infile(filename);
while(!infile.eof())
{
getline(infile,line);
if(numwords(line) > 1)
{
if(getword(line,0) == "v")
{
vec3 tmp;
tmp.x = atof(getword(line,1).c_str());
tmp.y = atof(getword(line,2).c_str());
tmp.z = atof(getword(line,3).c_str());
vectors[verts] = tmp;
verts++;
}
if(getword(line,0) == "f")
{
for(int i = 1; i<numwords(line); i++)
{
facevector[fv] = vectors[atoi(getword(line,i).c_str())];
fv++;
}
}
}
}
}
/* end model code */
Lol, on to inventory now.
Also, server is back online.