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 ?
thanks for that I got a step on the way but I can´t read the Faces now I don´t know whats wrong. I have found a source for reading the ase files. they use fscanf instead of sscanf as I do I have tried to make it almost the same as they have except that I use sscanf and read from a buffer instead of fscanf.
[This message has been edited by McZ (edited 03-01-2001).]
yes, use fscanf(“%s”, &data) where data is an array of 255 characters. then simply do a if(!strcmp(data, “data you are looking for”)) to see if you’re about to read vertices, normals or faces.
btw, it bothers me when someone feels high and mighty enough to complain about non-opengl subjects in this forum, there’s nothing wrong with asking a question that we all know can be answered by the people who read these forums.
Originally posted by s_fonden: yes, use fscanf(“%s”, &data) where data is an array of 255 characters. then simply do a if(!strcmp(data, “data you are looking for”)) to see if you’re about to read vertices, normals or faces.
Actually it should be fscanf(“%s”, data) if data is a char[255]. Passing it as &data would pass a pointer to the array pointer and the most likely result will be CRASH!!
thanks for your help but I think I have to learn little more about file reading and stuff my C++ book has only a little chapter but I got my .ASE reader to work but now I can´t rotate the object and I´m using the same rotating stuff as I did before and it worked OK then