PDA

View Full Version : read .ASE file



McZ
02-26-2001, 12:43 AM
I need help to read .ase files!

this is the way I do to read a line and save it for later use:

void LoadAse(char *filename)
{
char buff[200];
ifstream fin:

fin.open(filename);

do {
fin.getline(buff, sizeof(buff));

if(strcmp("*MESH_VERTEX", buff) == 0)
sscanf(buff, "*MESH_VERTEX %f %f %f", &object.x, &object.y, &object.z);

}while(!=fin.eof()) <-- how to check EOF ?

questions:
1. this line : sscanf(buff, "*MESH_VERTEX %f %f %f", &object.x, &object.y, &object.z); doesnīt work because the *MESH_VERTEX isnīt at the start of the line how to fix this ?

2. how to check if I am at the end of the file (EOF) ??

Thanks for your answers http://www.opengl.org/discussion_boards/ubb/smile.gif