   weird loading problem ~ hmmmmm.
  Hi all,ok, just wrote my own loader for VRML 1 file format, as exported from MilkShape 3D.  Works really nice, made classes etc to recieve / render the data, and now I''ve started testing different kinds of models.Well, when I try to load a mere sphere of 92 vertices, I find that I cannot allocate ANY dynamic memory in the loader function.  However, it all works fine for other ( more complex ) models, and I just don''t see what is going on.  Here we have :    IS >> dummy >> node->m_triangle_Number;OS << "Number of triangles : " << node->m_triangle_Number << endl;int memory_size = node->m_triangle_Number * 4;OS << "hello" << endl;node->m_vertexIndex = new int[memory_size];we get the hello sent to my text file, but the memory allocation fails.  Man, what is going on?  When I load a simple cube, I can do int *test = new int[8000]; no problem, but here I can''t allocate anything more than new int[240]; if that gives a clue.So weird.  Thanks all.  PS, it''s my first loader. * climbing ladder of newbiness * 
  just so you know, it seems to load much more complex things than a sphere no problem, this is a very weird exception.  The loader does in fact work in other cases.  Any thoughts? ;  What compiler are you using?  I''ve known the compiler that comes with Dev-C++ do weird things to me from time to time.Also when opening up the sphere model what is memory_size set at? ;  hey, microsoft VC++ 6.  memory_size is initialized right where you see it.  So there it is 180 triangles.  But much larger objects load up no problem.  Here is the whole thing, if you are interested ( second funtion calls the first ) : istream & Process_Object(istream &IS, ostream &OS, ostream &MEM, VR_Manager &VRM){string dummy;string data;int start;start = 0;VR_Object_Node *node = new VR_Object_Node;IS >> dummy >> node->m_name;OS << "\n\nName : " << node->m_name << endl;getline(IS, dummy);getline(IS, dummy);getline(IS, dummy);getline(IS, dummy);IS >> dummy >> node->m_textureName;OS << "Texture : " << node->m_textureName << endl << endl;getline(IS, dummy);getline(IS, dummy);getline(IS, dummy);// GET MATERIAL PROPERTIES //float temp[4];// holding temp resultsfloat results[12];// final valuesfor(int i = 0; i < 4; i++){IS >> dummy;getline(IS, data);while((start < data.size()) && data[start] == ' ' || data[start] == '\t')start++;// eliminate whitespace and tabsGetNumbers(data, temp, 3, start);for(int k = i * 3; k < ((i * 3) + 3); k++)results[k] = temp[k%3];start = 0;// reset to zero}node->m_colorAmbient[0] = results[0];// set the data node->m_colorAmbient[1] = results[1];node->m_colorAmbient[2] = results[2];node->m_colorDiffuse[0] = results[3];node->m_colorDiffuse[1] = results[4];node->m_colorDiffuse[2] = results[5];node->m_colorSpecular[0] = results[6];node->m_colorSpecular[1] = results[7];node->m_colorSpecular[2] = results[8];node->m_colorEmmisive[0] = results[9];node->m_colorEmmisive[1] = results[10];node->m_colorEmmisive[2] = results[11];IS >> dummy >> node->m_shine;IS >> dummy >> node->m_transparent;OS << node->m_colorAmbient[0] << " " << node->m_colorAmbient[1] << " " << node->m_colorAmbient[2] << " " << node->m_colorDiffuse[0] << " " << node->m_colorDiffuse[1] << " " << node->m_colorDiffuse[2] << " "<< node->m_colorSpecular[0] << " "<< node->m_colorSpecular[1] << " "<< node->m_colorSpecular[2] << " "<< node->m_colorEmmisive[0] << " "<< node->m_colorEmmisive[1] << " "<< node->m_colorEmmisive[2] << " "<< node->m_shine << " "<< node->m_transparent << endl;getline(IS, dummy);getline(IS, dummy);getline(IS, dummy);IS >> dummy >> node->m_triangle_Number;OS << "Number of triangles : " << node->m_triangle_Number << endl;int memory_size = node->m_triangle_Number * 4;int *test = new int[240];OS << "hello" << endl;node->m_vertexIndex = new int[memory_size];MEM << "vertexIndex : int : " << memory_size << endl;node->m_normalIndex = new int[memory_size];MEM << "normalIndex : int : " << memory_size << endl;node->m_texIndex = new int[memory_size];MEM << "texIndex : int : " << memory_size << endl;getline(IS, dummy);getline(IS, dummy);float indices[4];for(i = 0; i < node->m_triangle_Number; i++){getline(IS, data);while((start < data.size()) && data[start] == ' ' || data[start] == '\t')start++;// eliminate whitespace and tabsGetNumbers(data, indices, 4, start);for(int j = 0; j < 4; j++)node->m_vertexIndex[i * 4 + j] = indices[j];start = 0;// reset to zero}OS << "\nPrinting vertice indexes per triangle" << endl;for(i = 0; i < node->m_triangle_Number; i++){for(int j = 0; j < 4; j++){OS << node->m_vertexIndex[i * 4 + j] << " ";}OS << endl;}getline(IS, dummy);getline(IS, dummy);for(i = 0; i < node->m_triangle_Number; i++){getline(IS, data);while((start < data.size()) && data[start] == ' ' || data[start] == '\t')start++;// eliminate whitespace and tabsGetNumbers(data, indices, 4, start);for(int j = 0; j < 4; j++)node->m_normalIndex[i * 4 + j] = indices[j];start = 0;// reset to zero}OS << "\nPrinting vertices per triangle normal" << endl;for(i = 0; i < node->m_triangle_Number; i++){for(int j = 0; j < 4; j++){OS << node->m_normalIndex[i * 4 + j] << " ";}OS << endl;}getline(IS, dummy);getline(IS, dummy);for(i = 0; i < node->m_triangle_Number; i++){getline(IS, data);while((start < data.size()) && data[start] == ' ' || data[start] == '\t')start++;// eliminate whitespace and tabsGetNumbers(data, indices, 4, start);for(int j = 0; j < 4; j++)node->m_normalIndex[i * 4 + j] = indices[j];start = 0;// reset to zero}OS << "\nPrinting texture coords per triangle" << endl;for(i = 0; i < node->m_triangle_Number; i++){for(int j = 0; j < 4; j++){OS << node->m_normalIndex[i * 4 + j] << " ";}OS << endl;}VR_Object_Node *curr = VRM.m_head;if(VRM.m_head == NULL){VRM.m_head = node;VRM.m_object_number++;}else{while(curr->m_next != NULL)curr = curr->m_next;curr->m_next = node;VRM.m_object_number++;}getline(IS, dummy);getline(IS, dummy);getline(IS, dummy);getline(IS, dummy);return IS;}void Read_VRML(VR_Manager &VRM, string filename){ifstream IS(filename.c_str());ofstream OS("test.txt");ofstream MEM("memory_record.txt");string dummy;string data;int start = 0;getline(IS, dummy);// first line, file type and versionOS << dummy << endl;getline(IS, dummy);getline(IS, dummy);// generated by milkshapeOS << dummy << endl;for(int i = 0; i < 6; i++)// get the next six lines, we dont needgetline(IS, dummy);IS >> dummy >> VRM.m_vertex_number >> dummy;OS << "\nNumber of vertices : " << VRM.m_vertex_number << endl;getline(IS, dummy);// finish getting the rest of linegetline(IS, dummy);// throw awaygetline(IS, dummy);MEM << "vertices : point_3D : " << VRM.m_vertex_number << endl;VRM.m_vertices = new Point_3D[VRM.m_vertex_number];// allocate the memory// GET THE VERTICES //float results[3];// holding temp resultsfor(i = 0; i < VRM.m_vertex_number; i++){getline(IS, data);while((start < data.size()) && data[start] == ' ' || data[start] == '\t')start++;// eliminate whitespace and tabsGetNumbers(data, results, 3, start);for(int k = 0; k < 3; k++)// send to the output file for checkingOS << results[k] << " ";OS << endl;VRM.m_vertices[i].x = results[0];// set the dataVRM.m_vertices[i].y = results[1];VRM.m_vertices[i].z = results[2];start = 0;// reset to zero}// GET THE NORMALS //getline(IS, dummy);// we dont needgetline(IS, dummy);getline(IS, dummy);IS >> dummy >> VRM.m_normal_number >> dummy;OS << "\nNumber of normals : " << VRM.m_normal_number << endl;VRM.m_normals = new Vector_3D[VRM.m_normal_number];// allocate the memoryMEM << "normals : vector_3D : " << VRM.m_normal_number << endl;getline(IS, dummy);// we dont needgetline(IS, dummy);getline(IS, dummy);for(i = 0; i < VRM.m_normal_number; i++){getline(IS, data);while((start < data.size()) && data[start] == ' ' || data[start] == '\t')start++;// eliminate whitespace and tabsGetNumbers(data, results, 3, start);for(int k = 0; k < 3; k++)// send to the output file for checkingOS << results[k] << " ";OS << endl;VRM.m_normals[i].x = results[0];// set the dataVRM.m_normals[i].y = results[1];VRM.m_normals[i].z = results[2];start = 0;// reset to zero}// GET THE TEXTURE COORDS //getline(IS, dummy);// we dont needgetline(IS, dummy);getline(IS, dummy);IS >> dummy >> VRM.m_texture_number >> dummy;OS << "\nNumber of tex-coords : " << VRM.m_texture_number << endl;VRM.m_textures = new Point_2D[VRM.m_texture_number];// allocate the memoryMEM << "textures : point_3D : " << VRM.m_texture_number << endl;getline(IS, dummy);// we dont needgetline(IS, dummy);getline(IS, dummy);//float results[2];// holding temp resultsfor(i = 0; i < VRM.m_texture_number; i++){getline(IS, data);while((start < data.size()) && data[start] == ' ' || data[start] == '\t')start++;// eliminate whitespace and tabsGetNumbers(data, results, 2, start);for(int k = 0; k < 2; k++)// send to the output file for checkingOS << results[k] << " ";OS << endl;VRM.m_normals[i].x = results[0];// set the dataVRM.m_normals[i].y = results[1];start = 0;// reset to zero}getline(IS, dummy);// we dont needgetline(IS, dummy);getline(IS, dummy);// PROCESS SUB-OBJECTSchar ch = ' ';while(!IS.eof()){IS >> ch;if(ch == '#'){OS << "\n\nProcessing object" << endl;Process_Object(IS, OS, MEM, VRM);}}OS << "\nTotal Number of sub-items : " << VRM.m_object_number << endl;return;} [edited by - squirrel_of_death on December 30, 2003 5:55:58 PM];  Hum... I''m not sure, but I think that simple objects like sphere and cube are not descibe in VRML like other meshes. Have you the problem with every sphere or only with this one ? ;  i''ll be damned.  It doesnt work with any size of sphere ( singular ).  Same crash.  Let me investigate.  Very odd. ;  it does work with other spheres, my mistake.  This one works fine ( small example ) : #VRML V1.0 ascii# This file was generated by MilkShape 3D 1.6.6aSeparator {ShapeHints {vertexOrdering COUNTERCLOCKWISE}# 8 verticesCoordinate3 {point [0.000000 8.327778 0.106351,0.000000 -8.005556 0.106351,7.072541 -3.922222 0.106351,-3.536270 -3.922222 6.231351,-3.536270 -3.922222 -6.018649,7.072541 4.244445 0.106351,-3.536270 4.244445 6.231351,-3.536270 4.244445 -6.018649]}# 8 normalsNormal {vector [0.000000 -1.000000 0.000000,0.866025 -0.500000 0.000000,-0.433013 -0.500000 0.750000,0.000000 1.000000 0.000000,-0.433013 0.500000 0.750000,0.866025 0.500000 0.000000,-0.433013 -0.500000 -0.750000,-0.433013 0.500000 -0.750000]}# 14 texture coordinatesTextureCoordinate2 {point [0.000000 0.000000,0.000000 0.333333,0.333333 0.333333,0.000000 1.000000,0.333333 0.666667,0.000000 0.666667,0.333333 0.000000,0.666667 0.333333,0.333333 1.000000,0.666667 0.666667,0.666667 0.000000,1.000000 0.333333,0.666667 1.000000,1.000000 0.666667]}# Object: Sphere03Separator {Texture2 {filename ""}Material {ambientColor 0.20 0.20 0.20diffuseColor 0.80 0.80 0.80specularColor 0.00 0.00 0.00emissiveColor 0.00 0.00 0.00shininess 0.0000transparency 0.0000}IndexedFaceSet {# 12 trianglescoordIndex [1, 2, 3, -1,0, 6, 5, -1,1, 3, 4, -1,0, 7, 6, -1,1, 4, 2, -1,0, 5, 7, -1,2, 5, 3, -1,5, 6, 3, -1,3, 6, 7, -1,3, 7, 4, -1,4, 7, 2, -1,7, 5, 2, -1]normalIndex [0, 1, 2, -1,3, 4, 5, -1,0, 2, 6, -1,3, 7, 4, -1,0, 6, 1, -1,3, 5, 7, -1,1, 5, 2, -1,5, 4, 2, -1,2, 4, 7, -1,2, 7, 6, -1,6, 7, 1, -1,7, 5, 1, -1]textureCoordIndex [0, 1, 2, -1,3, 4, 5, -1,6, 2, 7, -1,8, 9, 4, -1,10, 7, 11, -1,12, 13, 9, -1,1, 5, 2, -1,5, 4, 2, -1,2, 4, 9, -1,2, 9, 7, -1,7, 9, 11, -1,9, 13, 11, -1]}}}and here is the one that gives me grief : #VRML V1.0 ascii# This file was generated by MilkShape 3D 1.6.6aSeparator {ShapeHints {vertexOrdering COUNTERCLOCKWISE}# 92 verticesCoordinate3 {point [0.166667 4.110512 -0.015327,0.166667 -3.889488 -0.015327,1.402735 -3.693714 -0.015327,1.166667 -3.693714 0.711215,0.548633 -3.693714 1.160243,-0.215299 -3.693714 1.160243,-0.833333 -3.693714 0.711215,-1.069401 -3.693714 -0.015327,-0.833333 -3.693714 -0.741870,-0.215299 -3.693714 -1.190898,0.548633 -3.693714 -1.190898,1.166667 -3.693714 -0.741870,2.517807 -3.125556 -0.015327,2.068780 -3.125556 1.366639,0.893209 -3.125556 2.220741,-0.559876 -3.125556 2.220741,-1.735446 -3.125556 1.366639,-2.184474 -3.125556 -0.015327,-1.735446 -3.125556 -1.397294,-0.559876 -3.125556 -2.251395,0.893209 -3.125556 -2.251395,2.068780 -3.125556 -1.397294,3.402735 -2.240630 -0.015327,2.784701 -2.240630 1.886786,1.166667 -2.240630 3.062356,-0.833333 -2.240630 3.062356,-2.451368 -2.240630 1.886786,-3.069402 -2.240630 -0.015327,-2.451368 -2.240630 -1.917441,-0.833333 -2.240630 -3.093010,1.166667 -2.240630 -3.093010,2.784701 -2.240630 -1.917441,3.970893 -1.125556 -0.015327,3.244350 -1.125556 2.220741,1.342237 -1.125556 3.602706,-1.008904 -1.125556 3.602706,-2.911017 -1.125556 2.220741,-3.637560 -1.125556 -0.015327,-2.911017 -1.125556 -2.251395,-1.008904 -1.125556 -3.633361,1.342237 -1.125556 -3.633361,3.244350 -1.125556 -2.251395,4.166667 0.110512 -0.015327,3.402735 0.110512 2.335814,1.402735 0.110512 3.788897,-1.069401 0.110512 3.788897,-3.069402 0.110512 2.335814,-3.833333 0.110512 -0.015327,-3.069402 0.110512 -2.366468,-1.069401 0.110512 -3.819553,1.402735 0.110512 -3.819553,3.402735 0.110512 -2.366468,3.970893 1.346580 -0.015327,3.244350 1.346580 2.220741,1.342237 1.346580 3.602706,-1.008904 1.346580 3.602706,-2.911017 1.346580 2.220741,-3.637560 1.346580 -0.015327,-2.911017 1.346580 -2.251395,-1.008904 1.346580 -3.633361,1.342237 1.346580 -3.633361,3.244350 1.346580 -2.251395,3.402735 2.461652 -0.015327,2.784701 2.461652 1.886786,1.166667 2.461652 3.062356,-0.833333 2.461652 3.062356,-2.451368 2.461652 1.886786,-3.069402 2.461652 -0.015327,-2.451368 2.461652 -1.917441,-0.833333 2.461652 -3.093010,1.166667 2.461652 -3.093010,2.784701 2.461652 -1.917441,2.517807 3.346580 -0.015327,2.068780 3.346580 1.366639,0.893209 3.346580 2.220741,-0.559876 3.346580 2.220741,-1.735446 3.346580 1.366639,-2.184474 3.346580 -0.015327,-1.735446 3.346580 -1.397294,-0.559876 3.346580 -2.251395,0.893209 3.346580 -2.251395,2.068780 3.346580 -1.397294,1.402735 3.914738 -0.015327,1.166667 3.914738 0.711215,0.548633 3.914738 1.160243,-0.215299 3.914738 1.160243,-0.833333 3.914738 0.711215,-1.069401 3.914738 -0.015327,-0.833333 3.914738 -0.741870,-0.215299 3.914738 -1.190898,0.548633 3.914738 -1.190898,1.166667 3.914738 -0.741870]}# 92 normalsNormal {vector [-0.000000 -1.000000 0.000000,0.358106 -0.933681 -0.000000,0.249423 -0.951288 0.181216,-0.000000 1.000000 0.000000,0.249423 0.951288 0.181216,0.358107 0.933681 -0.000000,0.110661 -0.933681 0.340579,0.110661 0.933681 0.340580,-0.095271 -0.951288 0.293214,-0.095271 0.951288 0.293214,-0.289714 -0.933681 0.210490,-0.289714 0.933681 0.210490,-0.308303 -0.951288 -0.000000,-0.308304 0.951288 -0.000000,-0.289714 -0.933681 -0.210490,-0.289714 0.933681 -0.210490,-0.095271 -0.951288 -0.293214,-0.095271 0.951288 -0.293214,0.110661 -0.933681 -0.340579,0.110661 0.933681 -0.340580,0.249423 -0.951288 -0.181216,0.249423 0.951288 -0.181216,0.586826 -0.809713 0.000000,0.474753 -0.809713 0.344928,0.181339 -0.809713 0.558105,-0.181339 -0.809713 0.558105,-0.474752 -0.809713 0.344928,-0.586826 -0.809713 0.000000,-0.474752 -0.809713 -0.344928,-0.181339 -0.809713 -0.558105,0.181339 -0.809713 -0.558105,0.474752 -0.809713 -0.344928,0.808340 -0.588715 -0.000000,0.653961 -0.588716 0.475130,0.249791 -0.588715 0.768778,-0.249791 -0.588715 0.768778,-0.653961 -0.588716 0.475131,-0.808340 -0.588715 0.000000,-0.653961 -0.588715 -0.475131,-0.249791 -0.588715 -0.768777,0.249791 -0.588715 -0.768777,0.653961 -0.588715 -0.475131,0.950842 -0.309677 -0.000000,0.769247 -0.309677 0.558891,0.293826 -0.309677 0.904305,-0.293826 -0.309677 0.904304,-0.769247 -0.309677 0.558891,-0.950842 -0.309677 -0.000000,-0.769247 -0.309677 -0.558891,-0.293826 -0.309677 -0.904304,0.293826 -0.309677 -0.904304,0.769247 -0.309677 -0.558891,1.000000 -0.000000 -0.000000,0.809017 -0.000000 0.587786,0.309017 -0.000000 0.951057,-0.309017 -0.000000 0.951057,-0.809017 -0.000000 0.587785,-1.000000 -0.000000 -0.000000,-0.809017 -0.000000 -0.587785,-0.309017 -0.000000 -0.951057,0.309017 -0.000000 -0.951057,0.809017 -0.000000 -0.587785,0.950842 0.309678 -0.000000,0.769247 0.309677 0.558891,0.293826 0.309677 0.904304,-0.293826 0.309677 0.904304,-0.769247 0.309677 0.558891,-0.950842 0.309677 -0.000000,-0.769247 0.309677 -0.558891,-0.293826 0.309677 -0.904304,0.293826 0.309677 -0.904304,0.769247 0.309677 -0.558891,0.808340 0.588715 0.000000,0.653961 0.588715 0.475130,0.249791 0.588715 0.768778,-0.249791 0.588715 0.768778,-0.653961 0.588715 0.475131,-0.808340 0.588715 0.000000,-0.653961 0.588715 -0.475131,-0.249791 0.588715 -0.768778,0.249791 0.588715 -0.768778,0.653961 0.588715 -0.475131,0.586827 0.809712 0.000000,0.474753 0.809712 0.344928,0.181340 0.809713 0.558105,-0.181339 0.809713 0.558105,-0.474753 0.809713 0.344928,-0.586827 0.809713 0.000000,-0.474753 0.809713 -0.344928,-0.181339 0.809712 -0.558106,0.181339 0.809712 -0.558106,0.474753 0.809712 -0.344928]}# 119 texture coordinatesTextureCoordinate2 {point [0.000000 0.000000,0.000000 0.100000,0.100000 0.100000,0.000000 1.000000,0.100000 0.900000,0.000000 0.900000,0.100000 0.000000,0.200000 0.100000,0.100000 1.000000,0.200000 0.900000,0.200000 0.000000,0.300000 0.100000,0.200000 1.000000,0.300000 0.900000,0.300000 0.000000,0.400000 0.100000,0.300000 1.000000,0.400000 0.900000,0.400000 0.000000,0.500000 0.100000,0.400000 1.000000,0.500000 0.900000,0.500000 0.000000,0.600000 0.100000,0.500000 1.000000,0.600000 0.900000,0.600000 0.000000,0.700000 0.100000,0.600000 1.000000,0.700000 0.900000,0.700000 0.000000,0.800000 0.100000,0.700000 1.000000,0.800000 0.900000,0.800000 0.000000,0.900000 0.100000,0.800000 1.000000,0.900000 0.900000,0.900000 0.000000,1.000000 0.100000,0.900000 1.000000,1.000000 0.900000,0.000000 0.200000,0.100000 0.200000,0.200000 0.200000,0.300000 0.200000,0.400000 0.200000,0.500000 0.200000,0.600000 0.200000,0.700000 0.200000,0.800000 0.200000,0.900000 0.200000,1.000000 0.200000,0.000000 0.300000,0.100000 0.300000,0.200000 0.300000,0.300000 0.300000,0.400000 0.300000,0.500000 0.300000,0.600000 0.300000,0.700000 0.300000,0.800000 0.300000,0.900000 0.300000,1.000000 0.300000,0.000000 0.400000,0.100000 0.400000,0.200000 0.400000,0.300000 0.400000,0.400000 0.400000,0.500000 0.400000,0.600000 0.400000,0.700000 0.400000,0.800000 0.400000,0.900000 0.400000,1.000000 0.400000,0.000000 0.500000,0.100000 0.500000,0.200000 0.500000,0.300000 0.500000,0.400000 0.500000,0.500000 0.500000,0.600000 0.500000,0.700000 0.500000,0.800000 0.500000,0.900000 0.500000,1.000000 0.500000,0.000000 0.600000,0.100000 0.600000,0.200000 0.600000,0.300000 0.600000,0.400000 0.600000,0.500000 0.600000,0.600000 0.600000,0.700000 0.600000,0.800000 0.600000,0.900000 0.600000,1.000000 0.600000,0.000000 0.700000,0.100000 0.700000,0.200000 0.700000,0.300000 0.700000,0.400000 0.700000,0.500000 0.700000,0.600000 0.700000,0.700000 0.700000,0.800000 0.700000,0.900000 0.700000,1.000000 0.700000,0.000000 0.800000,0.100000 0.800000,0.200000 0.800000,0.300000 0.800000,0.400000 0.800000,0.500000 0.800000,0.600000 0.800000,0.700000 0.800000,0.800000 0.800000,0.900000 0.800000,1.000000 0.800000]}# Object: Sphere04Separator {Texture2 {filename ""}Material {ambientColor 0.20 0.20 0.20diffuseColor 0.80 0.80 0.80specularColor 0.00 0.00 0.00emissiveColor 0.00 0.00 0.00shininess 0.0000transparency 0.0000}IndexedFaceSet {# 180 trianglescoordIndex [1, 2, 3, -1,0, 83, 82, -1,1, 3, 4, -1,0, 84, 83, -1,1, 4, 5, -1,0, 85, 84, -1,1, 5, 6, -1,0, 86, 85, -1,1, 6, 7, -1,0, 87, 86, -1,1, 7, 8, -1,0, 88, 87, -1,1, 8, 9, -1,0, 89, 88, -1,1, 9, 10, -1,0, 90, 89, -1,1, 10, 11, -1,0, 91, 90, -1,1, 11, 2, -1,0, 82, 91, -1,2, 12, 13, -1,2, 13, 3, -1,3, 13, 4, -1,13, 14, 4, -1,4, 14, 15, -1,4, 15, 5, -1,5, 15, 6, -1,15, 16, 6, -1,6, 16, 17, -1,6, 17, 7, -1,7, 17, 8, -1,17, 18, 8, -1,8, 18, 19, -1,8, 19, 9, -1,9, 19, 10, -1,19, 20, 10, -1,10, 20, 21, -1,10, 21, 11, -1,11, 21, 2, -1,21, 12, 2, -1,12, 22, 13, -1,22, 23, 13, -1,13, 23, 24, -1,13, 24, 14, -1,14, 24, 15, -1,24, 25, 15, -1,15, 25, 26, -1,15, 26, 16, -1,16, 26, 17, -1,26, 27, 17, -1,17, 27, 28, -1,17, 28, 18, -1,18, 28, 19, -1,28, 29, 19, -1,19, 29, 30, -1,19, 30, 20, -1,20, 30, 21, -1,30, 31, 21, -1,21, 31, 22, -1,21, 22, 12, -1,22, 32, 33, -1,22, 33, 23, -1,23, 33, 24, -1,33, 34, 24, -1,24, 34, 35, -1,24, 35, 25, -1,25, 35, 26, -1,35, 36, 26, -1,26, 36, 37, -1,26, 37, 27, -1,27, 37, 28, -1,37, 38, 28, -1,28, 38, 39, -1,28, 39, 29, -1,29, 39, 30, -1,39, 40, 30, -1,30, 40, 41, -1,30, 41, 31, -1,31, 41, 22, -1,41, 32, 22, -1,32, 42, 33, -1,42, 43, 33, -1,33, 43, 44, -1,33, 44, 34, -1,34, 44, 35, -1,44, 45, 35, -1,35, 45, 46, -1,35, 46, 36, -1,36, 46, 37, -1,46, 47, 37, -1,37, 47, 48, -1,37, 48, 38, -1,38, 48, 39, -1,48, 49, 39, -1,39, 49, 50, -1,39, 50, 40, -1,40, 50, 41, -1,50, 51, 41, -1,41, 51, 42, -1,41, 42, 32, -1,42, 52, 53, -1,42, 53, 43, -1,43, 53, 44, -1,53, 54, 44, -1,44, 54, 55, -1,44, 55, 45, -1,45, 55, 46, -1,55, 56, 46, -1,46, 56, 57, -1,46, 57, 47, -1,47, 57, 48, -1,57, 58, 48, -1,48, 58, 59, -1,48, 59, 49, -1,49, 59, 50, -1,59, 60, 50, -1,50, 60, 61, -1,50, 61, 51, -1,51, 61, 42, -1,61, 52, 42, -1,52, 62, 53, -1,62, 63, 53, -1,53, 63, 64, -1,53, 64, 54, -1,54, 64, 55, -1,64, 65, 55, -1,55, 65, 66, -1,55, 66, 56, -1,56, 66, 57, -1,66, 67, 57, -1,57, 67, 68, -1,57, 68, 58, -1,58, 68, 59, -1,68, 69, 59, -1,59, 69, 70, -1,59, 70, 60, -1,60, 70, 61, -1,70, 71, 61, -1,61, 71, 62, -1,61, 62, 52, -1,62, 72, 73, -1,62, 73, 63, -1,63, 73, 64, -1,73, 74, 64, -1,64, 74, 75, -1,64, 75, 65, -1,65, 75, 66, -1,75, 76, 66, -1,66, 76, 77, -1,66, 77, 67, -1,67, 77, 68, -1,77, 78, 68, -1,68, 78, 79, -1,68, 79, 69, -1,69, 79, 70, -1,79, 80, 70, -1,70, 80, 81, -1,70, 81, 71, -1,71, 81, 62, -1,81, 72, 62, -1,72, 82, 73, -1,82, 83, 73, -1,73, 83, 84, -1,73, 84, 74, -1,74, 84, 75, -1,84, 85, 75, -1,75, 85, 86, -1,75, 86, 76, -1,76, 86, 77, -1,86, 87, 77, -1,77, 87, 88, -1,77, 88, 78, -1,78, 88, 79, -1,88, 89, 79, -1,79, 89, 90, -1,79, 90, 80, -1,80, 90, 81, -1,90, 91, 81, -1,81, 91, 82, -1,81, 82, 72, -1]normalIndex [0, 1, 2, -1,3, 4, 5, -1,0, 2, 6, -1,3, 7, 4, -1,0, 6, 8, -1,3, 9, 7, -1,0, 8, 10, -1,3, 11, 9, -1,0, 10, 12, -1,3, 13, 11, -1,0, 12, 14, -1,3, 15, 13, -1,0, 14, 16, -1,3, 17, 15, -1,0, 16, 18, -1,3, 19, 17, -1,0, 18, 20, -1,3, 21, 19, -1,0, 20, 1, -1,3, 5, 21, -1,1, 22, 23, -1,1, 23, 2, -1,2, 23, 6, -1,23, 24, 6, -1,6, 24, 25, -1,6, 25, 8, -1,8, 25, 10, -1,25, 26, 10, -1,10, 26, 27, -1,10, 27, 12, -1,12, 27, 14, -1,27, 28, 14, -1,14, 28, 29, -1,14, 29, 16, -1,16, 29, 18, -1,29, 30, 18, -1,18, 30, 31, -1,18, 31, 20, -1,20, 31, 1, -1,31, 22, 1, -1,22, 32, 23, -1,32, 33, 23, -1,23, 33, 34, -1,23, 34, 24, -1,24, 34, 25, -1,34, 35, 25, -1,25, 35, 36, -1,25, 36, 26, -1,26, 36, 27, -1,36, 37, 27, -1,27, 37, 38, -1,27, 38, 28, -1,28, 38, 29, -1,38, 39, 29, -1,29, 39, 40, -1,29, 40, 30, -1,30, 40, 31, -1,40, 41, 31, -1,31, 41, 32, -1,31, 32, 22, -1,32, 42, 43, -1,32, 43, 33, -1,33, 43, 34, -1,43, 44, 34, -1,34, 44, 45, -1,34, 45, 35, -1,35, 45, 36, -1,45, 46, 36, -1,36, 46, 47, -1,36, 47, 37, -1,37, 47, 38, -1,47, 48, 38, -1,38, 48, 49, -1,38, 49, 39, -1,39, 49, 40, -1,49, 50, 40, -1,40, 50, 51, -1,40, 51, 41, -1,41, 51, 32, -1,51, 42, 32, -1,42, 52, 43, -1,52, 53, 43, -1,43, 53, 54, -1,43, 54, 44, -1,44, 54, 45, -1,54, 55, 45, -1,45, 55, 56, -1,45, 56, 46, -1,46, 56, 47, -1,56, 57, 47, -1,47, 57, 58, -1,47, 58, 48, -1,48, 58, 49, -1,58, 59, 49, -1,49, 59, 60, -1,49, 60, 50, -1,50, 60, 51, -1,60, 61, 51, -1,51, 61, 52, -1,51, 52, 42, -1,52, 62, 63, -1,52, 63, 53, -1,53, 63, 54, -1,63, 64, 54, -1,54, 64, 65, -1,54, 65, 55, -1,55, 65, 56, -1,65, 66, 56, -1,56, 66, 67, -1,56, 67, 57, -1,57, 67, 58, -1,67, 68, 58, -1,58, 68, 69, -1,58, 69, 59, -1,59, 69, 60, -1,69, 70, 60, -1,60, 70, 71, -1,60, 71, 61, -1,61, 71, 52, -1,71, 62, 52, -1,62, 72, 63, -1,72, 73, 63, -1,63, 73, 74, -1,63, 74, 64, -1,64, 74, 65, -1,74, 75, 65, -1,65, 75, 76, -1,65, 76, 66, -1,66, 76, 67, -1,76, 77, 67, -1,67, 77, 78, -1,67, 78, 68, -1,68, 78, 69, -1,78, 79, 69, -1,69, 79, 80, -1,69, 80, 70, -1,70, 80, 71, -1,80, 81, 71, -1,71, 81, 72, -1,71, 72, 62, -1,72, 82, 83, -1,72, 83, 73, -1,73, 83, 74, -1,83, 84, 74, -1,74, 84, 85, -1,74, 85, 75, -1,75, 85, 76, -1,85, 86, 76, -1,76, 86, 87, -1,76, 87, 77, -1,77, 87, 78, -1,87, 88, 78, -1,78, 88, 89, -1,78, 89, 79, -1,79, 89, 80, -1,89, 90, 80, -1,80, 90, 91, -1,80, 91, 81, -1,81, 91, 72, -1,91, 82, 72, -1,82, 5, 83, -1,5, 4, 83, -1,83, 4, 7, -1,83, 7, 84, -1,84, 7, 85, -1,7, 9, 85, -1,85, 9, 11, -1,85, 11, 86, -1,86, 11, 87, -1,11, 13, 87, -1,87, 13, 15, -1,87, 15, 88, -1,88, 15, 89, -1,15, 17, 89, -1,89, 17, 19, -1,89, 19, 90, -1,90, 19, 91, -1,19, 21, 91, -1,91, 21, 5, -1,91, 5, 82, -1]textureCoordIndex [0, 1, 2, -1,3, 4, 5, -1,6, 2, 7, -1,8, 9, 4, -1,10, 7, 11, -1,12, 13, 9, -1,14, 11, 15, -1,16, 17, 13, -1,18, 15, 19, -1,20, 21, 17, -1,22, 19, 23, -1,24, 25, 21, -1,26, 23, 27, -1,28, 29, 25, -1,30, 27, 31, -1,32, 33, 29, -1,34, 31, 35, -1,36, 37, 33, -1,38, 35, 39, -1,40, 41, 37, -1,1, 42, 43, -1,1, 43, 2, -1,2, 43, 7, -1,43, 44, 7, -1,7, 44, 45, -1,7, 45, 11, -1,11, 45, 15, -1,45, 46, 15, -1,15, 46, 47, -1,15, 47, 19, -1,19, 47, 23, -1,47, 48, 23, -1,23, 48, 49, -1,23, 49, 27, -1,27, 49, 31, -1,49, 50, 31, -1,31, 50, 51, -1,31, 51, 35, -1,35, 51, 39, -1,51, 52, 39, -1,42, 53, 43, -1,53, 54, 43, -1,43, 54, 55, -1,43, 55, 44, -1,44, 55, 45, -1,55, 56, 45, -1,45, 56, 57, -1,45, 57, 46, -1,46, 57, 47, -1,57, 58, 47, -1,47, 58, 59, -1,47, 59, 48, -1,48, 59, 49, -1,59, 60, 49, -1,49, 60, 61, -1,49, 61, 50, -1,50, 61, 51, -1,61, 62, 51, -1,51, 62, 63, -1,51, 63, 52, -1,53, 64, 65, -1,53, 65, 54, -1,54, 65, 55, -1,65, 66, 55, -1,55, 66, 67, -1,55, 67, 56, -1,56, 67, 57, -1,67, 68, 57, -1,57, 68, 69, -1,57, 69, 58, -1,58, 69, 59, -1,69, 70, 59, -1,59, 70, 71, -1,59, 71, 60, -1,60, 71, 61, -1,71, 72, 61, -1,61, 72, 73, -1,61, 73, 62, -1,62, 73, 63, -1,73, 74, 63, -1,64, 75, 65, -1,75, 76, 65, -1,65, 76, 77, -1,65, 77, 66, -1,66, 77, 67, -1,77, 78, 67, -1,67, 78, 79, -1,67, 79, 68, -1,68, 79, 69, -1,79, 80, 69, -1,69, 80, 81, -1,69, 81, 70, -1,70, 81, 71, -1,81, 82, 71, -1,71, 82, 83, -1,71, 83, 72, -1,72, 83, 73, -1,83, 84, 73, -1,73, 84, 85, -1,73, 85, 74, -1,75, 86, 87, -1,75, 87, 76, -1,76, 87, 77, -1,87, 88, 77, -1,77, 88, 89, -1,77, 89, 78, -1,78, 89, 79, -1,89, 90, 79, -1,79, 90, 91, -1,79, 91, 80, -1,80, 91, 81, -1,91, 92, 81, -1,81, 92, 93, -1,81, 93, 82, -1,82, 93, 83, -1,93, 94, 83, -1,83, 94, 95, -1,83, 95, 84, -1,84, 95, 85, -1,95, 96, 85, -1,86, 97, 87, -1,97, 98, 87, -1,87, 98, 99, -1,87, 99, 88, -1,88, 99, 89, -1,99, 100, 89, -1,89, 100, 101, -1,89, 101, 90, -1,90, 101, 91, -1,101, 102, 91, -1,91, 102, 103, -1,91, 103, 92, -1,92, 103, 93, -1,103, 104, 93, -1,93, 104, 105, -1,93, 105, 94, -1,94, 105, 95, -1,105, 106, 95, -1,95, 106, 107, -1,95, 107, 96, -1,97, 108, 109, -1,97, 109, 98, -1,98, 109, 99, -1,109, 110, 99, -1,99, 110, 111, -1,99, 111, 100, -1,100, 111, 101, -1,111, 112, 101, -1,101, 112, 113, -1,101, 113, 102, -1,102, 113, 103, -1,113, 114, 103, -1,103, 114, 115, -1,103, 115, 104, -1,104, 115, 105, -1,115, 116, 105, -1,105, 116, 117, -1,105, 117, 106, -1,106, 117, 107, -1,117, 118, 107, -1,108, 5, 109, -1,5, 4, 109, -1,109, 4, 9, -1,109, 9, 110, -1,110, 9, 111, -1,9, 13, 111, -1,111, 13, 17, -1,111, 17, 112, -1,112, 17, 113, -1,17, 21, 113, -1,113, 21, 25, -1,113, 25, 114, -1,114, 25, 115, -1,25, 29, 115, -1,115, 29, 33, -1,115, 33, 116, -1,116, 33, 117, -1,33, 37, 117, -1,117, 37, 41, -1,117, 41, 118, -1]}}};  ** covers red face of shame **note the beautiful cut and paste here : VRM.m_textures = new Point_2D[VRM.m_texture_number];// allocate the memoryMEM << "textures : point_3D : " << VRM.m_texture_number << endl;getline(IS, dummy);// we dont needgetline(IS, dummy);getline(IS, dummy);//float results[2];// holding temp resultsfor(i = 0; i < VRM.m_texture_number; i++){getline(IS, data);while((start < data.size()) && data[start] == ' ' || data[start] == '\t')start++;// eliminate whitespace and tabsGetNumbers(data, results, 2, start);for(int k = 0; k < 2; k++)// send to the output file for checkingOS << results[k] << " ";OS << endl;VRM.m_normals[i].x = results[0];// set the dataVRM.m_normals[i].y = results[1];start = 0;// reset to zero}yup, there is the beauty of texture variables being assigned to normals.  There goes 3 hours of my life!  Remember kids, watch that cut and paste.PS, point being I fixed it, and thanks for the help!   [edited by - squirrel_of_death on December 30, 2003 6:52:27 PM];  Well if you think that''s bad I spent an entire day trying to get my MD2 Loader to work and all it needed was a * 3 added to a for loop ;  he he, I''ll watch out for that.  They really should make these compilers smarter. 