Archived

This topic is now archived and is closed to further replies.

fallingbrickwork

My Object is not Showing any Materials?? - Look at Code

Recommended Posts

Hi All, I''m trying to use 3D Exploration to convert an object into OpenGL C++ Code using its built in plugin. When you run the sample Application that the program produces, the object displays correctly with textures etc. My small demo is written using GLUT and when I try to use sections of their App in my demo, the object displays correctly but with no textures!!!. Below is code which 3D Exploration Produces. How can I convert the code below to use GLUT?? I''m already using all their code except the Window Init sections. /* This file was produced by 3D Exploration Plugin: CPP Export filter. 3D Exploration Copyright (c) 1999-2000 X Dimension Software WWW http://www.xdsoft.com/explorer/ eMail info@xdsoft.com */ #include #include #include struct sample_MATERIAL{ GLfloat ambient[3]; GLfloat diffuse[3]; GLfloat specular[3]; GLfloat emission[3]; GLfloat alpha; GLfloat phExp; int texture; }; static sample_MATERIAL materials [6] = { {{0.0f,0.0f,0.0f}, {0.0f,0.0f,0.0f}, {0.0f,0.0f,0.0f}, {0.0f,0.0f,0.0f}, 1.0f,2.0f,-1}, //Fighter1 Dull 0 {{1.0f,1.0f,1.0f}, {1.0f,1.0f,1.0f}, {0.0f,0.0f,0.0f}, {0.0f,0.0f,0.0f}, 1.0f,2.0f,-1}, //Fighter1 Dull1 {{0.0f,0.0f,0.666667f}, {0.0f,0.0f,0.666667f}, {0.0f,0.0f,0.0f}, {0.0f,0.0f,0.0f}, 1.0f,252.544f,-1}, //Fighter1 Shiny {{1.0f,0.0f,0.0f}, {1.0f,0.0f,0.0f}, {0.0f,0.0f,0.0f}, {0.0f,0.0f,0.0f}, 1.0f,2.0f,-1}, //Fighter1 Dull 2 {{0.666667f,0.666667f,0.666667f}, {0.666667f,0.666667f,0.666667f}, {0.0f,0.0f,0.0f}, {0.0f,0.0f,0.0f}, 1.0f,2.0f,-1}, //Fighter1 Dull 1 {{1.0f,1.0f,0.0f}, {1.0f,1.0f,0.0f}, {0.0f,0.0f,0.0f}, {0.0f,0.0f,0.0f}, 1.0f,2.0f,-1} //Fighter1 Lumin }; // 332 Verticies // 0 Texture Coordinates // 314 Normals // 578 Triangles static short face_indicies[578][9] = { // Fighter1 {3,9,2 ,0,0,0 ,0,0,0}, {9,68,2 ,0,0,0 ,0,0,0}, {9,3,10 ,0,0,0 ,0,0,0}, {3,21,10 ,0,0,0 ,0,0,0}, {21,3,19 ,0,0,0 ,0,0,0}, {54,4,43 ,1,1,1 ,0,0,0}, {53,44,4 ,2,3,1 ,0,0,0}, {4,54,53 ,1,1,1 ,0,0,0}, {5,37,44 ,4,5,3 ,0,0,0}, {48,37,5 ,4,5,4 ,0,0,0}, {52,5,44 ,6,7,8 ,0,0,0}, {49,48,5 ,9,9,9 ,0,0,0}, {5,52,49 ,7,6,10 ,0,0,0}, {6,24,8 ,11,12,13 ,0,0,0}, {6,8,58 ,4,4,4 ,0,0,0}, {6,304,24 ,11,14,12 ,0,0,0}, {6,58,304 ,4,4,4 ,0,0,0}, {8,24,7 ,13,12,15 ,0,0,0}, {50,8,7 ,16,16,16 ,0,0,0}, {29,7,24 ,17,4,4 ,0,0,0}, {8,50,55 ,16,16,16 ,0,0,0}, {58,8,55 ,4,4,4 ,0,0,0}, {38,9,10 ,18,0,0 ,0,0,0}, {38,69,9 ,18,0,0 ,0,0,0}, {68,9,69 ,0,0,0 ,0,0,0}, {38,10,21 ,18,0,0 ,0,0,0}, {12,18,11 ,0,19,0 ,0,0,0}, {11,50,12 ,20,20,20 ,0,0,0}, {11,18,17 ,0,19,19 ,0,0,0}, {59,11,17 ,21,22,23 ,0,0,0}, {38,48,11 ,24,25,20 ,0,0,0}, {11,70,38 ,22,26,18 ,0,0,0}, {50,11,48 ,20,20,20 ,0,0,0}, {62,11,59 ,21,22,21 ,0,0,0}, {61,11,62 ,0,22,21 ,0,0,0}, {66,11,61 ,0,22,0 ,0,0,0}, {65,11,66 ,0,22,0 ,0,0,0}, {70,11,65 ,26,22,0 ,0,0,0}, {12,34,18 ,27,28,29 ,0,0,0}, {12,31,33 ,30,30,31 ,0,0,0}, {31,12,50 ,30,30,32 ,0,0,0}, {33,34,12 ,33,28,27 ,0,0,0}, {15,13,14 ,34,35,34 ,0,0,0}, {13,35,14 ,36,37,34 ,0,0,0}, {16,13,15 ,35,35,34 ,0,0,0}, {18,13,16 ,19,35,35 ,0,0,0}, {34,13,18 ,28,36,29 ,0,0,0}, {34,35,13 ,28,37,36 ,0,0,0}, {15,14,130 ,38,38,38 ,0,0,0}, {14,35,36 ,34,37,34 ,0,0,0}, {14,36,131 ,39,39,39 ,0,0,0}, {130,14,131 ,38,38,38 ,0,0,0}, {15,17,16 ,40,23,34 ,0,0,0}, {17,15,46 ,23,40,41 ,0,0,0}, {46,15,128 ,42,38,42 ,0,0,0}, {128,15,130 ,42,38,38 ,0,0,0}, {18,16,17 ,19,35,19 ,0,0,0}, {21,19,20 ,43,43,43 ,0,0,0}, {46,20,19 ,44,44,45 ,0,0,0}, {21,20,23 ,46,46,46 ,0,0,0}, {23,20,22 ,46,46,46 ,0,0,0}, {20,46,22 ,44,44,47 ,0,0,0}, {38,21,23 ,18,0,48 ,0,0,0}, {45,23,22 ,49,48,50 ,0,0,0}, {45,22,47 ,49,50,51 ,0,0,0}, {22,46,47 ,50,41,51 ,0,0,0}, {38,23,45 ,18,48,49 ,0,0,0}, {106,26,24 ,52,52,52 ,0,0,0}, {275,106,24 ,52,52,52 ,0,0,0}, {304,309,24 ,14,53,12 ,0,0,0}, {310,24,309 ,17,4,4 ,0,0,0}, {26,111,25 ,54,54,54 ,0,0,0}, {110,28,25 ,52,52,52 ,0,0,0}, {25,111,110 ,46,46,46 ,0,0,0}, {26,106,108 ,52,52,52 ,0,0,0}, {26,108,107 ,55,55,55 ,0,0,0}, {111,26,107 ,54,54,54 ,0,0,0}, {28,117,27 ,54,54,54 ,0,0,0}, {27,120,30 ,52,52,52 ,0,0,0}, {27,117,116 ,46,46,46 ,0,0,0}, {120,27,116 ,52,52,52 ,0,0,0}, {28,110,114 ,52,52,52 ,0,0,0}, {28,114,113 ,55,55,55 ,0,0,0}, {117,28,113 ,54,54,54 ,0,0,0}, {30,32,29 ,56,57,17 ,0,0,0}, {29,32,31 ,58,58,58 ,0,0,0}, {30,119,32 ,56,59,57 ,0,0,0}, {30,120,119 ,55,55,55 ,0,0,0}, {32,33,31 ,60,61,60 ,0,0,0}, {33,32,73 ,61,60,60 ,0,0,0}, {32,119,73 ,57,59,62 ,0,0,0}, {33,72,34 ,61,63,63 ,0,0,0}, {72,33,71 ,63,61,64 ,0,0,0}, {33,73,71 ,61,60,64 ,0,0,0}, {34,101,35 ,65,66,65 ,0,0,0}, {34,72,167 ,63,63,67 ,0,0,0}, {34,167,101 ,63,67,68 ,0,0,0}, {126,36,35 ,46,46,46 ,0,0,0}, {35,101,126 ,65,66,65 ,0,0,0}, {36,126,125 ,46,46,46 ,0,0,0}, {131,36,125 ,39,39,39 ,0,0,0}, {45,37,38 ,69,5,24 ,0,0,0}, {48,38,37 ,25,24,5 ,0,0,0}, {37,45,39 ,5,69,70 ,0,0,0}, {97,37,39 ,71,71,71 ,0,0,0}, {37,99,44 ,5,72,3 ,0,0,0}, {97,99,37 ,73,72,5 ,0,0,0}, {38,70,69 ,18,26,0 ,0,0,0}, {95,39,45 ,74,74,74 ,0,0,0}, {95,97,39 ,75,75,75 ,0,0,0}, {40,42,41 ,76,76,76 ,0,0,0}, {41,93,40 ,77,78,79 ,0,0,0}, {40,315,42 ,76,76,76 ,0,0,0}, {93,315,40 ,78,80,79 ,0,0,0}, {41,42,44 ,77,1,3 ,0,0,0}, {41,44,99 ,77,3,72 ,0,0,0}, {41,99,93 ,77,72,78 ,0,0,0}, {44,42,43 ,3,1,1 ,0,0,0}, {315,43,42 ,80,1,1 ,0,0,0}, {308,54,43 ,1,1,1 ,0,0,0}, {315,312,43 ,80,81,1 ,0,0,0}, {44,53,52 ,3,2,82 ,0,0,0}, {95,45,47 ,83,83,83 ,0,0,0}, {128,47,46 ,42,84,42 ,0,0,0}, {95,47,90 ,85,85,85 ,0,0,0}, {47,128,90 ,84,42,84 ,0,0,0}, {56,48,49 ,86,87,10 ,0,0,0}, {48,56,51 ,87,86,16 ,0,0,0}, {56,49,52 ,86,10,6 ,0,0,0}, {51,55,50 ,16,16,16 ,0,0,0}, {55,51,56 ,16,16,16 ,0,0,0}, {57,52,53 ,4,82,2 ,0,0,0}, {52,57,56 ,82,4,4 ,0,0,0}, {57,53,54 ,4,2,4 ,0,0,0}, {307,57,54 ,2,4,4 ,0,0,0}, {54,308,307 ,1,1,1 ,0,0,0}, {56,58,55 ,4,4,4 ,0,0,0}, {58,56,57 ,4,4,4 ,0,0,0}, {269,58,57 ,4,4,4 ,0,0,0}, {57,306,269 ,4,82,4 ,0,0,0}, {57,307,306 ,4,2,82 ,0,0,0}, {58,269,303 ,4,4,4 ,0,0,0}, {304,58,303 ,4,4,4 ,0,0,0}, {60,62,59 ,0,0,0 ,0,0,0}, {62,60,61 ,0,0,0 ,0,0,0}, {60,66,61 ,0,0,0 ,0,0,0}, {66,60,63 ,0,0,0 ,0,0,0}, {64,66,63 ,0,0,0 ,0,0,0}, {66,64,65 ,0,0,0 ,0,0,0}, {64,70,65 ,0,26,0 ,0,0,0}, {70,64,67 ,26,0,0 ,0,0,0}, {68,70,67 ,0,0,0 ,0,0,0}, {70,68,69 ,0,0,0 ,0,0,0}, {71,74,72 ,88,89,90 ,0,0,0}, {75,71,73 ,91,88,92 ,0,0,0}, {71,75,74 ,88,91,89 ,0,0,0}, {173,72,74 ,93,94,94 ,0,0,0}, {72,173,167 ,94,93,93 ,0,0,0}, {170,75,73 ,95,95,95 ,0,0,0}, {73,119,102 ,62,59,62 ,0,0,0}, {73,102,170 ,46,46,46 ,0,0,0}, {174,74,75 ,60,60,60 ,0,0,0}, {74,174,173 ,60,60,60 ,0,0,0}, {75,170,174 ,95,95,95 ,0,0,0}, {100,76,135 ,96,97,98 ,0,0,0}, {76,100,141 ,97,96,99 ,0,0,0}, {135,76,136 ,100,100,100 ,0,0,0}, {76,141,136 ,97,99,101 ,0,0,0}, {78,144,77 ,102,102,102 ,0,0,0}, {77,143,123 ,103,104,105 ,0,0,0}, {144,143,77 ,106,104,103 ,0,0,0}, {144,78,145 ,102,102,102 ,0,0,0}, {78,162,145 ,102,107,108 ,0,0,0}, {162,78,163 ,107,102,102 ,0,0,0}, {94,91,79 ,109,110,111 ,0,0,0}, {79,91,129 ,111,110,112 ,0,0,0}, {142,94,79 ,113,109,111 ,0,0,0}, {129,122,79 ,114,114,115 ,0,0,0}, {122,142,79 ,46,46,46 ,0,0,0}, {83,82,80 ,116,117,118 ,0,0,0}, {98,80,82 ,119,118,117 ,0,0,0}, {80,152,83 ,118,120,116 ,0,0,0}, {80,98,100 ,118,119,96 ,0,0,0}, {152,80,148 ,120,118,121 ,0,0,0}, {82,84,81 ,117,122,123 ,0,0,0}, {81,98,82 ,123,119,117 ,0,0,0}, {84,231,81 ,122,124,123 ,0,0,0}, {98,81,92 ,119,123,125 ,0,0,0}, {81,232,92 ,123,126,125 ,0,0,0}, {232,81,231 ,126,123,124 ,0,0,0}, {84,82,83 ,122,117,116 ,0,0,0}, {83,151,84 ,116,127,122 ,0,0,0}, {151,83,152 ,127,116,120 ,0,0,0}, {151,227,84 ,127,128,122 ,0,0,0}, {231,84,227 ,124,122,128 ,0,0,0}, {86,87,85 ,129,130,131 ,0,0,0}, {85,153,86 ,131,132,129 ,0,0,0}, {87,226,85 ,130,133,131 ,0,0,0}, {153,85,150 ,132,131,127 ,0,0,0}, {85,223,150 ,131,134,127 ,0,0,0}, {223,85,226 ,134,131,133 ,0,0,0}, {87,86,88 ,130,129,135 ,0,0,0}, {86,89,88 ,129,136,135 ,0,0,0}, {86,153,89 ,129,132,136 ,0,0,0}, {88,105,87 ,135,127,130 ,0,0,0}, {221,87,105 ,137,130,127 ,0,0,0}, {221,222,87 ,137,138,130 ,0,0,0}, {226,87,222 ,133,130,138 ,0,0,0}, {88,89,104 ,135,136,139 ,0,0,0}, {88,104,105 ,135,139,127 ,0,0,0}, {89,153,149 ,136,132,121 ,0,0,0}, {95,90,91 ,85,85,85 ,0,0,0}, {128,91,90 ,42,84,84 ,0,0,0}, {95,91,94 ,140,140,140 ,0,0,0}, {91,128,129 ,84,42,42 ,0,0,0}, {93,98,92 ,141,119,125 ,0,0,0}, {232,93,92 ,126,141,125 ,0,0,0}, {98,93,99 ,119,141,142 ,0,0,0}, {93,232,217 ,141,126,143 ,0,0,0}, {312,93,217 ,81,78,144 ,0,0,0}, {315,93,312 ,80,78,81 ,0,0,0}, {95,94,96 ,145,145,145 ,0,0,0}, {94,100,96 ,146,96,147 ,0,0,0}, {100,94,141 ,96,146,99 ,0,0,0}, {141,94,142 ,148,109,113 ,0,0,0}, {95,96,97 ,75,75,75 ,0,0,0}, {97,96,100 ,71,71,71 ,0,0,0}, {97,100,99 ,149,96,142 ,0,0,0}, {100,98,99 ,96,119,142 ,0,0,0}, {101,137,126 ,66,65,65 ,0,0,0}, {101,138,137 ,68,150,151 ,0,0,0}, {138,101,168 ,150,68,152 ,0,0,0}, {168,101,167 ,152,68,67 ,0,0,0}, {119,169,102 ,153,154,154 ,0,0,0}, {169,170,102 ,46,46,46 ,0,0,0}, {103,121,104 ,155,156,139 ,0,0,0}, {104,134,103 ,157,157,157 ,0,0,0}, {121,103,119 ,156,155,153 ,0,0,0}, {119,103,169 ,153,155,154 ,0,0,0}, {138,103,134 ,150,60,60 ,0,0,0}, {138,169,103 ,150,60,60 ,0,0,0}, {109,106,105 ,158,158,158 ,0,0,0}, {106,199,105 ,158,158,158 ,0,0,0}, {106,109,108 ,158,158,158 ,0,0,0}, {199,106,195 ,158,158,158 ,0,0,0}, {106,275,195 ,52,52,52 ,0,0,0}, {109,107,108 ,55,55,55 ,0,0,0}, {109,111,107 ,159,159,159 ,0,0,0}, {111,109,112 ,159,159,159 ,0,0,0}, {112,110,111 ,46,46,46 ,0,0,0}, {115,110,112 ,158,158,158 ,0,0,0}, {110,115,114 ,158,158,158 ,0,0,0}, {115,113,114 ,55,55,55 ,0,0,0}, {115,117,113 ,159,159,159 ,0,0,0}, {117,115,118 ,159,159,159 ,0,0,0}, {118,116,117 ,46,46,46 ,0,0,0}, {118,120,116 ,158,158,158 ,0,0,0}, {120,118,121 ,158,158,158 ,0,0,0}, {121,119,120 ,55,55,55 ,0,0,0}, {122,129,123 ,114,114,160 ,0,0,0}, {143,122,123 ,43,43,43 ,0,0,0}, {143,142,122 ,46,46,46 ,0,0,0}, {126,124,132 ,161,162,163 ,0,0,0}, {137,124,126 ,164,162,161 ,0,0,0}, {124,127,133 ,165,165,163 ,0,0,0}, {139,127,124 ,166,165,165 ,0,0,0}, {124,133,132 ,165,163,163 ,0,0,0}, {124,137,139 ,162,164,167 ,0,0,0}, {126,132,125 ,161,163,163 ,0,0,0}, {131,125,132 ,39,39,39 ,0,0,0}, {146,133,127 ,168,169,163 ,0,0,0}, {127,139,146 ,165,166,166 ,0,0,0}, {129,128,133 ,42,42,38 ,0,0,0}, {133,128,130 ,38,42,38 ,0,0,0}, {133,146,129 ,169,168,112 ,0,0,0}, {132,130,131 ,38,38,38 ,0,0,0}, {133,130,132 ,38,38,38 ,0,0,0}, {134,140,138 ,170,170,171 ,0,0,0}, {140,134,149 ,170,170,172 ,0,0,0}, {136,148,135 ,101,100,98 ,0,0,0}, {148,136,147 ,100,101,100 ,0,0,0}, {138,140,137 ,173,174,164 ,0,0,0}, {137,140,139 ,164,174,167 ,0,0,0}, {138,168,166 ,150,152,64 ,0,0,0}, {169,138,166 ,60,150,64 ,0,0,0}, {140,147,139 ,107,107,166 ,0,0,0}, {139,147,146 ,166,107,166 ,0,0,0}, {140,149,147 ,100,100,100 ,0,0,0}, {142,147,141 ,113,175,148 ,0,0,0}, {143,147,142 ,104,175,113 ,0,0,0}, {144,147,143 ,106,175,104 ,0,0,0}, {145,147,144 ,108,175,106 ,0,0,0}, {162,147,145 ,107,175,108 ,0,0,0}, {147,157,146 ,175,176,168 ,0,0,0}, {146,157,156 ,168,176,102 ,0,0,0}, {147,149,148 ,100,100,100 ,0,0,0}, {147,154,157 ,175,177,176 ,0,0,0}, {147,161,154 ,175,108,177 ,0,0,0}, {147,158,161 ,175,177,108 ,0,0,0}, {147,165,158 ,175,108,177 ,0,0,0}, {165,147,162 ,108,175,107 ,0,0,0}, {149,152,148 ,121,120,121 ,0,0,0}, {152,149,153 ,120,121,178 ,0,0,0}, {151,153,150 ,127,178,127 ,0,0,0}, {223,151,150 ,179,127,127 ,0,0,0}, {153,151,152 ,178,127,120 ,0,0,0}, {151,223,229 ,127,179,180 ,0,0,0}, {227,151,229 ,128,127,180 ,0,0,0}, {155,157,154 ,102,102,102 ,0,0,0}, {154,160,155 ,177,102,102 ,0,0,0}, {160,154,161 ,102,177,108 ,0,0,0}, {157,155,156 ,102,102,102 ,0,0,0}, {159,161,158 ,102,102,102 ,0,0,0}, {158,164,159 ,177,102,102 ,0,0,0}, {164,158,165 ,102,177,108 ,0,0,0}, {161,159,160 ,102,102,102 ,0,0,0}, {163,165,162 ,102,102,102 ,0,0,0}, {165,163,164 ,102,102,102 ,0,0,0}, {166,168,172 ,181,182,183 ,0,0,0}, {171,169,166 ,184,185,181 ,0,0,0}, {166,172,171 ,181,183,184 ,0,0,0}, {168,167,172 ,94,93,94 ,0,0,0}, {172,167,173 ,94,93,93 ,0,0,0}, {171,170,169 ,95,95,95 ,0,0,0}, {170,171,174 ,95,95,95 ,0,0,0}, {172,174,171 ,60,60,60 ,0,0,0}, {174,172,173 ,60,60,60 ,0,0,0}, {180,177,178 ,60,60,60 ,0,0,0}, {177,267,178 ,60,60,60 ,0,0,0}, {177,180,179 ,60,60,60 ,0,0,0}, {179,206,177 ,186,186,186 ,0,0,0}, {206,266,177 ,186,186,186 ,0,0,0}, {267,177,266 ,60,60,60 ,0,0,0}, {211,180,178 ,187,188,187 ,0,0,0}, {178,271,211 ,187,188,187 ,0,0,0}, {271,178,267 ,188,187,188 ,0,0,0}, {213,179,180 ,189,190,191 ,0,0,0}, {206,179,208 ,186,186,186 ,0,0,0}, {179,213,208 ,190,189,192 ,0,0,0}, {212,180,211 ,188,188,187 ,0,0,0}, {213,180,212 ,189,191,193 ,0,0,0}, {181,183,182 ,194,195,196 ,0,0,0}, {247,181,182 ,197,197,197 ,0,0,0}, {248,183,181 ,198,195,194 ,0,0,0}, {181,247,248 ,197,197,197 ,0,0,0}, {182,183,186 ,196,195,199 ,0,0,0}, {184,190,183 ,200,201,200 ,0,0,0}, {184,183,224 ,202,202,202 ,0,0,0}, {183,190,186 ,200,201,201 ,0,0,0}, {224,183,228 ,202,202,202 ,0,0,0}, {265,228,183 ,203,202,202 ,0,0,0}, {245,183,248 ,204,195,198 ,0,0,0}, {252,183,245 ,198,195,204 ,0,0,0}, {249,183,252 ,205,195,198 ,0,0,0}, {183,249,264 ,195,205,206 ,0,0,0}, {184,236,190 ,207,208,209 ,0,0,0}, {184,210,214 ,210,210,211 ,0,0,0}, {210,184,224 ,210,210,212 ,0,0,0}, {214,236,184 ,213,208,207 ,0,0,0}, {218,188,185 ,214,215,215 ,0,0,0}, {188,234,185 ,215,215,215 ,0,0,0}, {285,218,185 ,215,214,215 ,0,0,0}, {185,234,235 ,215,215,215 ,0,0,0}, {287,185,235 ,215,215,215 ,0,0,0}, {285,185,287 ,215,215,215 ,0,0,0}, {188,186,187 ,216,199,217 ,0,0,0}, {190,187,186 ,201,218,201 ,0,0,0}, {186,188,240 ,199,216,219 ,0,0,0}, {187,189,188 ,218,218,217 ,0,0,0}, {190,189,187 ,201,218,218 ,0,0,0}, {188,189,234 ,217,218,217 ,0,0,0}, {240,188,218 ,220,215,214 ,0,0,0}, {236,189,190 ,208,221,209 ,0,0,0}, {189,237,234 ,221,222,217 ,0,0,0}, {236,237,189 ,208,222,221 ,0,0,0}, {191,200,192 ,158,158,158 ,0,0,0}, {278,191,192 ,52,52,52 ,0,0,0}, {200,191,205 ,158,158,158 ,0,0,0}, {205,191,204 ,46,46,46 ,0,0,0}, {279,204,191 ,46,46,46 ,0,0,0}, {191,278,279 ,52,52,52 ,0,0,0}, {200,201,192 ,55,55,55 ,0,0,0}, {278,192,201 ,55,55,55 ,0,0,0}, {203,194,193 ,158,158,158 ,0,0,0}, {194,277,193 ,52,52,52 ,0,0,0}, {203,193,202 ,46,46,46 ,0,0,0}, {277,202,193 ,46,46,46 ,0,0,0}, {196,197,194 ,55,55,55 ,0,0,0}, {194,203,196 ,158,158,158 ,0,0,0}, {276,194,197 ,55,55,55 ,0,0,0}, {277,194,276 ,52,52,52 ,0,0,0}, {199,195,198 ,46,46,46 ,0,0,0}, {275,198,195 ,46,46,46 ,0,0,0}, {199,197,196 ,159,159,159 ,0,0,0}, {197,199,198 ,159,159,159 ,0,0,0}, {275,197,198 ,54,54,54 ,0,0,0}, {197,275,276 ,54,54,54 ,0,0,0}, {203,201,200 ,159,159,159 ,0,0,0}, {201,203,202 ,159,159,159 ,0,0,0}, {277,201,202 ,54,54,54 ,0,0,0}, {201,277,278 ,54,54,54 ,0,0,0}, {205,204,209 ,223,224,225 ,0,0,0}, {208,204,207 ,154,224,154 ,0,0,0}, {204,273,207 ,226,62,62 ,0,0,0}, {209,204,208 ,225,224,154 ,0,0,0}, {204,274,273 ,226,227,62 ,0,0,0}, {279,274,204 ,228,227,226 ,0,0,0}, {205,209,221 ,223,225,137 ,0,0,0}, {208,207,206 ,55,55,55 ,0,0,0}, {273,206,207 ,55,55,55 ,0,0,0}, {266,206,273 ,186,186,186 ,0,0,0}, {214,209,208 ,229,60,60 ,0,0,0}, {214,208,213 ,229,60,230 ,0,0,0}, {209,214,210 ,60,229,60 ,0,0,0}, {221,209,210 ,231,231,231 ,0,0,0}, {236,212,211 ,232,232,233 ,0,0,0}, {236,211,238 ,232,233,234 ,0,0,0}, {271,238,211 ,235,234,233 ,0,0,0}, {212,214,213 ,232,229,230 ,0,0,0}, {214,212,236 ,229,232,232 ,0,0,0}, {220,216,215 ,236,236,236 ,0,0,0}, {216,263,215 ,237,237,237 ,0,0,0}, {220,215,243 ,238,238,238 ,0,0,0}, {263,243,215 ,239,240,241 ,0,0,0}, {216,217,263 ,242,143,239 ,0,0,0}, {216,311,217 ,243,244,144 ,0,0,0}, {220,270,216 ,236,236,236 ,0,0,0}, {216,270,311 ,237,237,237 ,0,0,0}, {263,217,232 ,239,143,126 ,0,0,0}, {311,312,217 ,244,81,144 ,0,0,0}, {239,218,219 ,245,214,245 ,0,0,0}, {218,289,219 ,214,245,245 ,0,0,0}, {218,239,240 ,214,245,220 ,0,0,0}, {284,218,285 ,220,214,215 ,0,0,0}, {289,218,284 ,245,214,220 ,0,0,0}, {220,239,219 ,246,246,246 ,0,0,0}, {220,219,289 ,246,246,246 ,0,0,0}, {220,243,239 ,247,247,247 ,0,0,0}, {220,290,270 ,248,248,248 ,0,0,0}, {220,289,290 ,249,249,249 ,0,0,0}, {222,221,225 ,138,137,250 ,0,0,0}, {226,222,225 ,133,138,250 ,0,0,0}, {223,225,224 ,134,250,251 ,0,0,0}, {224,229,223 ,251,180,179 ,0,0,0}, {226,225,223 ,133,250,134 ,0,0,0}, {229,224,228 ,180,251,251 ,0,0,0}, {229,230,227 ,180,252,128 ,0,0,0}, {227,230,231 ,128,252,124 ,0,0,0}, {230,229,228 ,252,180,251 ,0,0,0}, {228,265,262 ,202,203,253 ,0,0,0}, {230,232,231 ,252,126,124 ,0,0,0}, {232,230,263 ,126,252,239 ,0,0,0}, {235,234,233 ,254,254,254 ,0,0,0}, {234,237,233 ,217,222,217 ,0,0,0}, {286,235,233 ,254,254,254 ,0,0,0}, {237,286,233 ,55,55,55 ,0,0,0}, {287,235,286 ,254,254,254 ,0,0,0}, {238,237,236 ,255,256,256 ,0,0,0}, {238,281,237 ,255,256,256 ,0,0,0}, {286,237,281 ,55,55,55 ,0,0,0}, {293,238,271 ,257,234,235 ,0,0,0}, {292,281,238 ,256,256,255 ,0,0,0}, {238,293,292 ,234,257,258 ,0,0,0}, {241,240,239 ,259,219,260 ,0,0,0}, {243,241,239 ,261,259,260 ,0,0,0}, {242,240,241 ,262,262,263 ,0,0,0}, {240,242,258 ,262,262,160 ,0,0,0}, {244,242,241 ,55,55,55 ,0,0,0}, {244,241,243 ,264,259,261 ,0,0,0}, {257,242,244 ,55,55,55 ,0,0,0}, {257,258,242 ,43,43,43 ,0,0,0}, {264,244,243 ,206,264,261 ,0,0,0}, {243,263,264 ,240,239,265 ,0,0,0}, {264,257,244 ,206,266,264 ,0,0,0}, {248,246,245 ,198,197,204 ,0,0,0}, {251,245,246 ,197,197,197 ,0,0,0}, {245,251,252 ,197,197,197 ,0,0,0}, {246,248,247 ,197,198,197 ,0,0,0}, {252,250,249 ,198,197,205 ,0,0,0}, {255,249,250 ,197,197,197 ,0,0,0}, {249,255,256 ,197,197,197 ,0,0,0}, {264,249,256 ,206,205,198 ,0,0,0}, {250,252,251 ,197,198,197 ,0,0,0}, {256,254,253 ,198,197,204 ,0,0,0}, {254,260,253 ,197,197,197 ,0,0,0}, {264,256,253 ,206,198,204 ,0,0,0}, {264,253,260 ,206,204,267 ,0,0,0}, {254,256,255 ,197,198,197 ,0,0,0}, {260,254,259 ,197,197,197 ,0,0,0}, {257,259,258 ,266,268,269 ,0,0,0}, {260,259,257 ,267,268,266 ,0,0,0}, {264,260,257 ,206,267,266 ,0,0,0}, {263,262,261 ,239,253,270 ,0,0,0}, {262,265,261 ,202,202,202 ,0,0,0}, {263,261,265 ,239,270,203 ,0,0,0}, {263,265,264 ,239,203,265 ,0,0,0}, {272,267,266 ,271,272,273 ,0,0,0}, {266,273,272 ,273,274,271 ,0,0,0}, {272,271,267 ,271,275,272 ,0,0,0}, {268,303,269 ,276,276,276 ,0,0,0}, {269,314,268 ,277,278,276 ,0,0,0}, {303,268,302 ,276,276,276 ,0,0,0}, {305,269,306 ,279,277,280 ,0,0,0}, {269,305,314 ,277,279,278 ,0,0,0}, {290,311,270 ,281,244,282 ,0,0,0}, {293,271,272 ,257,235,230 ,0,0,0}, {273,293,272 ,60,257,230 ,0,0,0}, {293,273,274 ,257,60,60 ,0,0,0}, {274,279,310 ,227,228,17 ,0,0,0}, {293,274,291 ,257,60,60 ,0,0,0}, {310,291,274 ,283,283,283 ,0,0,0}, {284,280,288 ,284,284,285 ,0,0,0}, {280,284,330 ,284,284,45 ,0,0,0}, {280,299,288 ,55,55,55 ,0,0,0}, {331,299,280 ,55,55,55 ,0,0,0}, {331,280,330 ,43,43,43 ,0,0,0}, {281,282,287 ,286,287,288 ,0,0,0}, {292,282,281 ,289,287,286 ,0,0,0}, {281,287,286 ,286,288,288 ,0,0,0}, {282,283,285 ,290,290,288 ,0,0,0}, {294,283,282 ,291,290,290 ,0,0,0}, {282,285,287 ,290,288,288 ,0,0,0}, {282,292,294 ,287,289,292 ,0,0,0}, {296,285,283 ,293,294,288 ,0,0,0}, {283,294,296 ,290,291,291 ,0,0,0}, {285,296,284 ,294,293,295 ,0,0,0}, {288,289,284 ,296,297,295 ,0,0,0}, {290,289,288 ,298,297,296 ,0,0,0}, {290,288,299 ,298,296,299 ,0,0,0}, {300,290,299 ,299,298,299 ,0,0,0}, {311,290,300 ,244,281,300 ,0,0,0}, {291,295,293 ,301,301,302 ,0,0,0}, {295,291,302 ,301,301,303 ,0,0,0}, {293,295,292 ,304,305,289 ,0,0,0}, {292,295,294 ,289,305,292 ,0,0,0}, {295,301,294 ,306,306,291 ,0,0,0}, {294,301,296 ,291,306,291 ,0,0,0}, {302,301,295 ,307,307,307 ,0,0,0}, {296,298,297 ,293,308,306 ,0,0,0}, {301,298,296 ,309,308,293 ,0,0,0}, {298,317,297 ,306,306,306 ,0,0,0}, {301,316,298 ,309,306,308 ,0,0,0}, {317,298,316 ,306,306,306 ,0,0,0}, {299,301,300 ,299,309,299 ,0,0,0}, {331,301,299 ,306,309,299 ,0,0,0}, {314,300,301 ,310,300,307 ,0,0,0}, {300,314,311 ,300,310,244 ,0,0,0}, {301,302,314 ,307,307,307 ,0,0,0}, {301,319,316 ,309,306,306 ,0,0,0}, {301,320,319 ,309,306,306 ,0,0,0}, {301,323,320 ,309,306,306 ,0,0,0}, {323,301,324 ,306,309,306 ,0,0,0}, {324,301,327 ,306,309,306 ,0,0,0}, {327,301,328 ,306,309,306 ,0,0,0}, {328,301,331 ,306,309,306 ,0,0,0}, {302,304,303 ,276,276,276 ,0,0,0}, {304,302,309 ,276,276,276 ,0,0,0}, {306,313,305 ,280,311,279 ,0,0,0}, {305,313,314 ,312,312,312 ,0,0,0}, {307,312,306 ,2,81,82 ,0,0,0}, {313,306,312 ,311,280,313 ,0,0,0}, {312,307,308 ,81,2,1 ,0,0,0}, {311,313,312 ,244,4,81 ,0,0,0}, {314,313,311 ,4,4,244 ,0,0,0}, {319,317,316 ,306,306,306 ,0,0,0}, {317,319,318 ,306,306,306 ,0,0,0}, {319,321,318 ,306,306,306 ,0,0,0}, {321,319,320 ,306,306,306 ,0,0,0}, {323,321,320 ,306,306,306 ,0,0,0}, {321,323,322 ,306,306,306 ,0,0,0}, {323,325,322 ,306,306,306 ,0,0,0}, {325,323,324 ,306,306,306 ,0,0,0}, {327,325,324 ,306,306,306 ,0,0,0}, {325,327,326 ,306,306,306 ,0,0,0}, {327,329,326 ,306,306,306 ,0,0,0}, {329,327,328 ,306,306,306 ,0,0,0}, {331,329,328 ,306,306,306 ,0,0,0}, {329,331,330 ,306,306,306 ,0,0,0} }; static GLfloat vertices [332][3] = { {-0.116163f,0.151163f,-0.0232558f},{-0.162791f,0.383721f,-0.0232558f},{-0.27907f,0.0348837f,0.0232558f}, {-0.27907f,0.0465116f,0.0232558f},{-0.0348837f,0.0581395f,0.0465116f},{-0.0581395f,0.0232558f,0.0465116f}, {0.0f,-0.267442f,0.116279f},{-0.116279f,-0.325581f,0.0465116f},{-0.0465116f,-0.255814f,0.116279f}, {-0.22093f,0.0348837f,0.0581395f},{-0.22093f,0.0465116f,0.0581395f},{-0.162791f,-0.151163f,0.0930233f}, {-0.162791f,-0.325581f,0.0930233f},{-0.395349f,-0.232558f,6.93077e-09f},{-0.395349f,-0.011628f,6.93077e-09f}, {-0.337209f,0.0697674f,0.0116279f},{-0.337209f,-0.151163f,0.0116279f},{-0.27907f,-0.151163f,0.0232558f}, {-0.27907f,-0.27907f,0.0232558f},{-0.27907f,0.0697674f,0.0232558f},{-0.22093f,0.0697674f,0.0232558f}, {-0.22093f,0.0697674f,0.0581395f},{-0.22093f,0.290698f,0.0232558f},{-0.22093f,0.151163f,0.0581395f}, {0.0f,-0.360465f,0.0465116f},{-0.0348837f,-0.360465f,0.0465116f},{-0.0116279f,-0.360465f,0.0465116f}, {-0.0813953f,-0.360465f,0.0465116f},{-0.0581395f,-0.360465f,0.0465116f},{-0.116279f,-0.360465f,0.0465116f}, {-0.104651f,-0.360465f,0.0465116f},{-0.116163f,-0.430233f,0.0465116f},{-0.116279f,-0.430233f,0.0116279f}, {-0.162791f,-0.430233f,0.0930233f},{-0.27907f,-0.383721f,0.0231395f},{-0.453488f,-0.313954f,-0.0116279f}, {-0.453488f,-0.0930233f,-0.0116279f},{-0.116163f,0.151163f,0.0465116f},{-0.162791f,0.151163f,0.0930233f}, {-0.139419f,0.383721f,0.0116279f},{0.0f,0.197674f,6.93077e-09f},{-0.0232558f,0.127907f,0.0232558f}, {0.0f,0.127907f,0.0232558f},{0.0f,0.0581395f,0.0465116f},{-0.0465116f,0.0581395f,0.0465116f}, {-0.162791f,0.383721f,0.0348837f},{-0.27907f,0.151163f,0.0231395f},{-0.22093f,0.383721f,-0.000116271f}, {-0.116279f,-0.151163f,0.0465116f},{-0.0581395f,-0.151163f,0.104651f},{-0.116279f,-0.244186f,0.0465116f}, {-0.116279f,-0.197674f,0.0465116f},{-0.0465116f,-0.151163f,0.116279f},{-0.0348837f,-0.151163f,0.116279f}, {0.0f,-0.151163f,0.116279f},{-0.0465116f,-0.244186f,0.116279f},{-0.0465116f,-0.197674f,0.116279f}, {0.0f,-0.197674f,0.116279f},{0.0f,-0.244186f,0.116279f},{-0.27907f,-0.0697675f,0.0232558f}, {-0.27907f,-0.0581396f,0.0232558f},{-0.22093f,-0.0581396f,0.0581395f},{-0.22093f,-0.0697675f,0.0581395f}, {-0.27907f,-0.035f,0.0232558f},{-0.27907f,-0.0232558f,0.0232558f},{-0.22093f,-0.0232558f,0.0581395f}, {-0.22093f,-0.035f,0.0581395f},{-0.27907f,-2.77231e-08f,0.0232558f},{-0.27907f,0.0116279f,0.0232558f}, {-0.22093f,0.0116279f,0.0581395f},{-0.22093f,-2.77231e-08f,0.0581395f},{-0.162791f,-0.430233f,0.0348837f}, {-0.22093f,-0.406977f,-0.000116271f},{-0.127907f,-0.430233f,0.0116279f},{-0.197674f,-0.372093f,-0.000116271f}, {-0.151163f,-0.372093f,-0.000116271f},{-0.139535f,0.0465116f,-0.0930232f},{-0.27907f,0.0465116f,-0.0581395f}, {-0.27907f,0.0348837f,-0.0581395f},{-0.22093f,0.308139f,-0.0581395f},{-0.116279f,-0.0813954f,-0.0813953f}, {0.0f,-0.0232558f,-0.0813953f},{-0.0581395f,-0.0232558f,-0.0813953f},{-0.0581395f,-0.0813954f,-0.116279f}, {0.0f,-0.0813954f,-0.116279f},{0.0f,-0.267442f,-0.116279f},{-0.0581395f,-0.267442f,-0.116279f}, {0.0f,-0.325581f,-0.0813953f},{-0.0581395f,-0.325581f,-0.0813953f},{-0.116279f,-0.267326f,-0.0813953f}, {-0.22093f,0.383721f,-0.0232558f},{-0.22093f,0.383721f,-0.0465116f},{0.0f,0.0581395f,-0.0813953f}, {0.0f,0.267442f,-0.0232558f},{-0.162791f,0.383721f,-0.0696511f},{-0.162791f,0.5f,-0.0232558f}, {-0.139419f,0.383721f,-0.0465116f},{-0.139419f,0.383721f,-0.0232558f},{-0.0465116f,0.0581395f,-0.0813953f}, {-0.0465116f,0.267442f,-0.0232558f},{-0.116163f,0.151163f,-0.0813953f},{-0.27907f,-0.383721f,-0.0232558f}, {-0.127907f,-0.5f,-0.0232558f},{-0.116279f,-0.430233f,-0.0523256f},{-0.116279f,-0.360465f,-0.0813953f}, {0.0f,-0.360465f,-0.0813953f},{0.0f,-0.430233f,-0.0232558f},{-0.0116279f,-0.5f,-0.0232558f}, {-0.0116279f,-0.430233f,-0.0232558f},{-0.0116279f,-0.360465f,-0.0813953f},{-0.0348837f,-0.430233f,-0.0232558f}, {-0.0348837f,-0.5f,-0.0232558f},{-0.0348837f,-0.360465f,-0.0813953f},{-0.0581395f,-0.5f,-0.0232558f}, {-0.0581395f,-0.430233f,-0.0232558f},{-0.0581395f,-0.360465f,-0.0813953f},{-0.0813953f,-0.430233f,-0.0232558f}, {-0.0813953f,-0.5f,-0.0232558f},{-0.0813953f,-0.360465f,-0.0813953f},{-0.104651f,-0.5f,-0.0232558f}, {-0.104651f,-0.430233f,-0.0232558f},{-0.104651f,-0.360465f,-0.0813953f},{-0.22093f,0.0697674f,-0.0581395f}, {-0.27907f,0.0697674f,-0.0581395f},{-0.395349f,-0.232558f,-0.0348837f},{-0.453488f,-0.0930233f,-0.0232558f}, {-0.453488f,-0.313954f,-0.0232558f},{-0.337209f,-0.151163f,-0.0465116f},{-0.27907f,0.151163f,-0.0232558f}, {-0.27907f,0.151163f,-0.0580232f},{-0.337209f,0.0697674f,-0.0232558f},{-0.395349f,-0.011628f,-0.0232558f}, {-0.395349f,-0.011628f,-0.0348837f},{-0.337209f,0.0697674f,-0.0465116f},{-0.116163f,-0.430233f,-0.0813953f}, {-0.116279f,-0.0232558f,-0.0813953f},{-0.162791f,-0.0232558f,-0.104651f},{-0.27907f,-0.383721f,-0.0580232f}, {-0.162791f,-0.430233f,-0.104651f},{-0.27907f,-0.27907f,-0.0581395f},{-0.162791f,-0.325581f,-0.104651f}, {-0.162791f,0.151163f,-0.104651f},{-0.22093f,0.151163f,-0.0812791f},{-0.22093f,0.0697674f,-0.0812791f}, {-0.22093f,0.0465116f,-0.0813953f},{-0.22093f,0.0348837f,-0.0813953f},{-0.27907f,-0.151163f,-0.0581395f}, {-0.162791f,-0.151163f,-0.104651f},{-0.116279f,-0.151163f,-0.0813953f},{-0.116279f,-0.244186f,-0.0813953f}, {0.0f,-0.244186f,-0.116279f},{0.0f,-0.151163f,-0.116279f},{-0.0581395f,-0.151163f,-0.116279f}, {-0.0581395f,-0.244186f,-0.116279f},{-0.22093f,-0.0581396f,-0.0813953f},{-0.27907f,-0.0581396f,-0.0581395f}, {-0.27907f,-0.0697675f,-0.0581395f},{-0.22093f,-0.0697675f,-0.0813953f},{-0.22093f,-0.0232558f,-0.0813953f}, {-0.27907f,-0.0232558f,-0.0581395f},{-0.27907f,-0.035f,-0.0581395f},{-0.22093f,-0.035f,-0.0813953f}, {-0.22093f,0.0116279f,-0.0813953f},{-0.27907f,0.0116279f,-0.0581395f},{-0.27907f,-2.77231e-08f,-0.0581395f}, {-0.22093f,-2.77231e-08f,-0.0813953f},{-0.162791f,-0.430233f,-0.0697674f},{-0.22093f,-0.406977f,-0.0232558f}, {-0.22093f,-0.406977f,-0.0465116f},{-0.127907f,-0.430233f,-0.0523256f},{-0.127907f,-0.430233f,-0.0232558f}, {-0.151163f,-0.372093f,-0.0347674f},{-0.197674f,-0.372093f,-0.0347674f},{-0.197674f,-0.372093f,-0.0232558f}, {-0.151163f,-0.372093f,-0.0232558f},{0.162791f,0.383721f,-0.0232558f},{0.116163f,0.151163f,-0.0232558f}, {0.151163f,-0.372093f,-0.0232558f},{0.197674f,-0.372093f,-0.0232558f},{0.151163f,-0.372093f,-0.0347674f}, {0.197674f,-0.372093f,-0.0347674f},{0.22093f,-0.0697675f,-0.0813953f},{0.27907f,-0.0697675f,-0.0581395f}, {0.162791f,-0.151163f,-0.104651f},{0.162791f,-0.325581f,-0.104651f},{0.337209f,0.0697674f,-0.0232558f}, {0.27907f,-0.151163f,-0.0581395f},{0.337209f,-0.151163f,-0.0465116f},{0.337209f,0.0697674f,-0.0465116f}, {0.395349f,-0.232558f,-0.0348837f},{0.27907f,-0.27907f,-0.0581395f},{0.104651f,-0.430233f,-0.0232558f}, {0.0813953f,-0.430233f,-0.0232558f},{0.0581395f,-0.430233f,-0.0232558f},{0.0348837f,-0.430233f,-0.0232558f}, {0.0116279f,-0.430233f,-0.0232558f},{0.0348837f,-0.360465f,-0.0813953f},{0.0348837f,-0.5f,-0.0232558f}, {0.0116279f,-0.5f,-0.0232558f},{0.0116279f,-0.360465f,-0.0813953f},{0.0813953f,-0.360465f,-0.0813953f}, {0.0813953f,-0.5f,-0.0232558f},{0.0581395f,-0.5f,-0.0232558f},{0.0581395f,-0.360465f,-0.0813953f}, {0.104651f,-0.5f,-0.0232558f},{0.104651f,-0.360465f,-0.0813953f},{0.127907f,-0.430233f,-0.0232558f}, {0.127907f,-0.5f,-0.0232558f},{0.127907f,-0.430233f,-0.0523256f},{0.116279f,-0.430233f,-0.0523256f}, {0.116163f,-0.430233f,-0.0813953f},{0.22093f,-0.406977f,-0.0232558f},{0.22093f,-0.406977f,-0.0465116f}, {0.162791f,-0.430233f,-0.0697674f},{0.162791f,-0.430233f,-0.104651f},{0.139419f,0.383721f,-0.0465116f}, {0.139419f,0.383721f,-0.0232558f},{0.0465116f,0.267442f,-0.0232558f},{0.27907f,0.151163f,-0.0232558f}, {0.22093f,0.383721f,-0.0232558f},{0.162791f,0.5f,-0.0232558f},{0.116279f,-0.360465f,-0.0813953f}, {0.0581395f,-0.325581f,-0.0813953f},{0.0581395f,-0.244186f,-0.116279f},{0.116279f,-0.244186f,-0.0813953f}, {0.116279f,-0.267326f,-0.0813953f},{0.0581395f,-0.267442f,-0.116279f},{0.0581395f,-0.0813954f,-0.116279f}, {0.116279f,-0.151163f,-0.0813953f},{0.0581395f,-0.151163f,-0.116279f},{0.116279f,-0.0813954f,-0.0813953f}, {0.0581395f,-0.0232558f,-0.0813953f},{0.0465116f,0.0581395f,-0.0813953f},{0.453488f,-0.0930233f,-0.0232558f}, {0.395349f,-0.011628f,-0.0348837f},{0.395349f,-0.011628f,-0.0232558f},{0.27907f,-0.383721f,-0.0580232f}, {0.453488f,-0.313954f,-0.0232558f},{0.27907f,-0.383721f,-0.0232558f},{0.22093f,0.383721f,-0.0465116f}, {0.27907f,0.151163f,-0.0580232f},{0.22093f,0.308139f,-0.0581395f},{0.22093f,0.0697674f,-0.0581395f}, {0.162791f,0.383721f,-0.0696511f},{0.22093f,0.151163f,-0.0812791f},{0.22093f,-0.035f,-0.0813953f}, {0.27907f,-0.035f,-0.0581395f},{0.27907f,-0.0581396f,-0.0581395f},{0.22093f,-0.0581396f,-0.0813953f}, {0.22093f,-2.77231e-08f,-0.0813953f},{0.27907f,-2.77231e-08f,-0.0581395f},{0.27907f,-0.0232558f,-0.0581395f}, {0.22093f,-0.0232558f,-0.0813953f},{0.22093f,0.0348837f,-0.0813953f},{0.27907f,0.0348837f,-0.0581395f}, {0.27907f,0.0116279f,-0.0581395f},{0.22093f,0.0116279f,-0.0813953f},{0.22093f,0.0697674f,-0.0812791f}, {0.27907f,0.0697674f,-0.0581395f},{0.27907f,0.0465116f,-0.0581395f},{0.22093f,0.0465116f,-0.0813953f}, {0.139535f,0.0465116f,-0.0930232f},{0.116279f,-0.0232558f,-0.0813953f},{0.116163f,0.151163f,-0.0813953f}, {0.162791f,0.151163f,-0.104651f},{0.162791f,-0.0232558f,-0.104651f},{0.151163f,-0.372093f,-0.000116271f}, {0.197674f,-0.372093f,-0.000116271f},{0.116279f,-0.197674f,0.0465116f},{0.0465116f,-0.197674f,0.116279f}, {0.139419f,0.383721f,0.0116279f},{0.22093f,-0.406977f,-0.000116271f},{0.162791f,-0.430233f,0.0348837f}, {0.127907f,-0.430233f,0.0116279f},{0.116279f,-0.430233f,0.0116279f},{0.0116279f,-0.360465f,0.0465116f}, {0.0348837f,-0.360465f,0.0465116f},{0.0581395f,-0.360465f,0.0465116f},{0.0813953f,-0.360465f,0.0465116f}, {0.104651f,-0.360465f,0.0465116f},{0.22093f,0.0697674f,0.0232558f},{0.453488f,-0.313954f,-0.0116279f}, {0.395349f,-0.232558f,6.93077e-09f},{0.337209f,-0.151163f,0.0116279f},{0.27907f,0.151163f,0.0231395f}, {0.337209f,0.0697674f,0.0116279f},{0.453488f,-0.0930233f,-0.0116279f},{0.395349f,-0.011628f,6.93077e-09f}, {0.22093f,0.290698f,0.0232558f},{0.22093f,0.383721f,-0.000116271f},{0.162791f,0.383721f,0.0348837f}, {0.116163f,-0.430233f,0.0465116f},{0.27907f,-0.383721f,0.0231395f},{0.162791f,-0.430233f,0.0930233f}, {0.27907f,-0.27907f,0.0232558f},{0.162791f,-0.325581f,0.0930233f},{0.27907f,-0.151163f,0.0232558f}, {0.27907f,-0.0697675f,0.0232558f},{0.22093f,-0.0697675f,0.0581395f},{0.22093f,0.151163f,0.0581395f}, {0.162791f,0.151163f,0.0930233f},{0.162791f,-0.151163f,0.0930233f},{0.116279f,-0.244186f,0.0465116f}, {0.0465116f,-0.244186f,0.116279f},{0.0465116f,-0.255814f,0.116279f},{0.0581395f,-0.151163f,0.104651f}, {0.0465116f,-0.151163f,0.116279f},{0.0348837f,-0.151163f,0.116279f},{0.0348837f,0.0581395f,0.0465116f}, {0.116279f,-0.325581f,0.0465116f},{0.116279f,-0.360465f,0.0465116f},{0.116163f,0.151163f,0.0465116f}, {0.0465116f,0.0581395f,0.0465116f},{0.0581395f,0.0232558f,0.0465116f},{0.116279f,-0.151163f,0.0465116f}, {0.0232558f,0.127907f,0.0232558f},{0.22093f,-0.0581396f,0.0581395f},{0.27907f,-0.0581396f,0.0232558f}, {0.27907f,-0.035f,0.0232558f},{0.22093f,-0.035f,0.0581395f},{0.22093f,-0.0232558f,0.0581395f}, {0.27907f,-0.0232558f,0.0232558f},{0.27907f,-2.77231e-08f,0.0232558f},{0.22093f,-2.77231e-08f,0.0581395f}, {0.22093f,0.0116279f,0.0581395f},{0.27907f,0.0116279f,0.0232558f},{0.27907f,0.0348837f,0.0232558f}, {0.22093f,0.0348837f,0.0581395f},{0.22093f,0.0465116f,0.0581395f},{0.27907f,0.0465116f,0.0232558f}, {0.27907f,0.0697674f,0.0232558f},{0.22093f,0.0697674f,0.0581395f} }; static GLfloat normals [314][3] = { {0.514496f,0.0f,-0.857493f},{0.0f,-0.316228f,-0.948683f},{0.0f,-0.160182f,-0.987087f}, {-0.0564831f,-0.271836f,-0.960685f},{0.0f,0.0f,-1.0f},{-0.43467f,-0.142799f,-0.889197f}, {0.698687f,-0.153859f,-0.698687f},{0.688247f,-0.229416f,-0.688247f},{0.688247f,-0.229416f,-0.688247f}, {0.688247f,-0.229416f,-0.688247f},{0.705011f,-0.0769292f,-0.705012f},{0.0f,0.6f,-0.8f}, {0.0f,0.604854f,-0.796337f},{0.164158f,0.596648f,-0.785534f},{-0.164158f,0.596648f,-0.785534f}, {0.179928f,0.59976f,-0.779688f},{0.707107f,0.0f,-0.707107f},{0.0f,0.229753f,-0.973249f}, {0.514264f,-0.0300262f,-0.857106f},{0.360597f,0.0f,-0.932722f},{-0.707107f,0.0f,-0.707107f}, {0.514496f,7.30152e-09f,-0.857493f},{0.514496f,2.08615e-09f,-0.857493f},{0.305784f,-0.000127416f,-0.952101f}, {-0.705322f,-0.0582042f,-0.706494f},{-0.706665f,0.000135819f,-0.707548f},{0.514496f,0.0f,-0.857493f}, {0.514951f,0.000476285f,-0.85722f},{0.360828f,0.000610285f,-0.932632f},{0.360948f,0.00103619f,-0.932585f}, {-0.706472f,-0.00022086f,-0.707741f},{-0.706224f,0.0f,-0.707989f},{-0.70672f,-0.000441721f,-0.707493f}, {0.515126f,0.0f,-0.857114f},{0.196116f,0.0f,-0.980581f},{0.196116f,0.0f,-0.980581f}, {0.196093f,0.000484212f,-0.980585f},{0.195953f,0.00012107f,-0.980613f},{0.813734f,-0.581238f,0.0f}, {0.813733f,-0.581238f,0.0f},{0.195427f,-0.000188624f,-0.980718f},{0.357716f,-0.107468f,-0.927626f}, {0.907873f,-0.419245f,0.0f},{0.0f,-1.0f,0.0f},{0.000999986f,-0.000714276f,-0.999999f}, {0.0f,-0.00142855f,-0.999999f},{1.0f,0.0f,0.0f},{0.00199997f,0.0f,-0.999998f}, {0.509397f,-0.140436f,-0.848995f},{0.503446f,-0.209886f,-0.838147f},{0.50445f,-0.210072f,-0.837496f}, {0.505142f,-0.210302f,-0.837022f},{0.0f,0.707107f,-0.707107f},{-0.179928f,0.59976f,-0.779688f}, {0.0f,0.447214f,-0.894427f},{-1.0f,0.0f,0.0f},{-2.6656e-07f,0.447214f,-0.894427f}, {-1.77707e-07f,0.447214f,-0.894427f},{-0.999993f,-0.00166673f,0.00333347f},{-1.77707e-07f,0.447214f,-0.894427f}, {0.0f,1.0f,0.0f},{0.151174f,0.988507f,-9.00167e-09f},{0.0f,0.447214f,-0.894427f}, {0.371391f,0.928477f,-1.4743e-08f},{0.189108f,0.981956f,0.0f},{0.371391f,0.928477f,0.0f}, {0.371391f,0.928477f,0.0f},{0.371391f,0.928477f,0.0f},{0.371391f,0.928477f,3.68944e-08f}, {-0.694988f,-0.174225f,-0.697594f},{-0.694561f,-0.174161f,-0.698035f},{-0.995037f,-0.0995037f,0.0f}, {-0.195057f,-0.31208f,-0.929817f},{-0.376161f,-0.300552f,-0.876454f},{-0.664818f,-0.334071f,-0.668142f}, {-0.980392f,-0.197059f,0.0f},{0.0f,-0.316228f,-0.948683f},{-9.42432e-08f,-0.316228f,-0.948683f}, {0.0f,-0.316228f,-0.948683f},{0.0f,-0.316228f,-0.948683f},{9.42432e-08f,-0.316228f,-0.948683f}, {0.0564831f,-0.271836f,-0.960685f},{0.0f,-0.106632f,-0.994299f},{0.474089f,-0.393761f,-0.787523f}, {0.970143f,-0.242536f,0.0f},{0.894427f,-0.447214f,0.0f},{0.707107f,7.02447e-08f,-0.707107f}, {0.707107f,1.05367e-07f,-0.707107f},{0.0377794f,0.418825f,0.907281f},{-0.212497f,0.407234f,0.88826f}, {-0.412685f,0.275124f,0.86833f},{0.26856f,0.456816f,0.848053f},{0.516797f,0.363308f,0.775195f}, {-0.83205f,0.5547f,0.0f},{-0.83205f,0.5547f,0.0f},{0.928477f,0.371391f,0.0f}, {-0.395479f,-0.120424f,0.910546f},{-0.446678f,0.000181882f,0.894695f},{-0.446856f,0.00014884f,0.894606f}, {-0.446177f,-0.0444972f,0.893838f},{-0.447214f,0.0f,0.894427f},{-0.447214f,0.0f,0.894427f}, {0.371391f,0.0f,0.928477f},{0.370589f,-0.00232121f,0.928794f},{0.367965f,-0.00232798f,0.929837f}, {0.369788f,0.0f,0.929116f},{0.366822f,-0.00310398f,0.930286f},{0.371391f,0.0f,0.928477f}, {0.371391f,0.0f,0.928477f},{0.365052f,-0.138626f,0.920609f},{0.373724f,-0.141039f,0.916754f}, {0.36905f,-0.139388f,0.918898f},{0.290194f,-0.0709971f,0.954331f},{0.369642f,-0.0687559f,0.926627f}, {0.000999986f,-0.000714276f,0.999999f},{0.00199997f,0.0f,0.999998f},{0.207525f,-0.207525f,0.955964f}, {0.0965199f,-0.313611f,0.944633f},{0.313611f,-0.0965199f,0.944633f},{-0.0488688f,-0.114306f,0.992243f}, {0.354404f,0.0f,0.935092f},{0.514496f,0.0f,0.857493f},{0.0f,-0.354404f,0.935092f}, {0.0f,-0.177202f,0.984174f},{-0.0965199f,-0.313611f,0.944633f},{0.0f,-0.135059f,0.990838f}, {0.0488688f,-0.114306f,0.992243f},{0.0f,0.0f,1.0f},{-0.207525f,-0.207525f,0.955964f}, {0.207646f,0.31728f,0.92532f},{0.0f,0.304828f,0.952407f},{0.0f,0.177202f,0.984174f}, {0.266934f,0.0f,0.963715f},{-0.207646f,0.31728f,0.92532f},{-0.266934f,0.0f,0.963715f}, {0.0966102f,0.204893f,0.974005f},{0.390405f,0.120046f,0.912783f},{0.0f,0.0975714f,0.995229f}, {-0.121358f,0.257379f,0.95866f},{0.0f,0.130454f,0.991454f},{0.346729f,-0.3476f,0.871179f}, {0.0f,-0.267644f,0.963518f},{-0.223416f,-0.263154f,0.938528f},{0.223416f,-0.263154f,0.938528f}, {0.259507f,-0.307957f,-0.915324f},{-0.676879f,-0.272789f,0.683682f},{-0.57475f,-0.155807f,0.80336f}, {-0.6928f,-0.174244f,0.699763f},{0.372093f,-0.0693154f,0.925604f},{-0.325197f,-0.259832f,0.909249f}, {0.189108f,0.981956f,2.50482e-08f},{0.371391f,0.928477f,0.0f},{0.371391f,0.928477f,4.91925e-08f}, {-1.52832e-07f,0.384615f,0.923077f},{0.0f,0.384615f,0.923077f},{-1.52832e-07f,0.384615f,0.923077f}, {-2.29249e-07f,0.384615f,0.923077f},{-0.999991f,-0.00166673f,-0.00400015f},{0.0f,0.640184f,0.768221f}, {0.0f,0.384615f,0.923077f},{0.0f,-0.00142855f,0.999999f},{0.195953f,0.00012107f,0.980613f}, {0.196093f,0.000484212f,0.980585f},{0.196116f,0.0f,0.980581f},{0.285228f,0.000623657f,0.958459f}, {0.196116f,0.0f,0.980581f},{0.284947f,0.0f,0.958543f},{0.285335f,0.00106491f,0.958427f}, {0.28461f,-9.46986e-05f,0.958643f},{0.195427f,-0.000188624f,0.980718f},{-0.446572f,-0.000139639f,0.894748f}, {-0.446321f,0.0f,0.894873f},{-0.446823f,-0.000279277f,0.894623f},{0.372191f,0.0f,0.928156f}, {0.371969f,0.000515734f,0.928245f},{0.370437f,-0.00042448f,0.928858f},{0.371391f,1.71295e-08f,0.928477f}, {0.371391f,0.0f,0.928477f},{0.177202f,0.0f,0.984174f},{-0.177202f,0.0f,0.984174f}, {-0.354404f,0.0f,0.935092f},{0.0765652f,0.464554f,-0.882229f},{-0.185822f,0.422536f,-0.887093f}, {-0.0934282f,0.471756f,-0.876765f},{0.208721f,0.473418f,-0.855752f},{0.407976f,0.409608f,-0.815952f}, {-0.928477f,0.371391f,0.0f},{0.83205f,0.5547f,0.0f},{0.83205f,0.5547f,0.0f}, {-0.0765652f,0.464554f,-0.882229f},{-0.208721f,0.473418f,-0.855752f},{0.0934282f,0.471756f,-0.876765f}, {-0.407976f,0.409608f,-0.815952f},{0.185822f,0.422536f,-0.887093f},{-0.371391f,5.13886e-08f,0.928477f}, {-0.371391f,1.46824e-08f,0.928477f},{-0.371391f,5.13886e-08f,0.928477f},{-0.371391f,0.0f,0.928477f}, {-0.371391f,0.0f,0.928477f},{-0.255038f,-0.000126223f,0.966931f},{-0.371391f,0.0f,0.928477f}, {-0.284947f,0.0f,0.958543f},{0.447214f,0.0f,0.894427f},{0.447892f,0.000375698f,0.894088f}, {-0.371391f,0.0f,0.928477f},{-0.371391f,0.0f,0.928477f},{-0.372795f,-0.0204418f,0.927689f}, {-0.371969f,0.000515734f,0.928245f},{-0.285228f,0.000623657f,0.958459f},{-0.285335f,0.00106491f,0.958427f}, {0.446572f,-0.000139639f,0.894748f},{0.446321f,0.0f,0.894873f},{0.446823f,-0.000279277f,0.894623f}, {-0.372191f,0.0f,0.928156f},{-0.907873f,-0.419245f,0.0f},{-0.813734f,-0.581238f,0.0f}, {-0.195427f,-0.000188624f,0.980718f},{-0.196116f,0.0f,0.980581f},{-0.196116f,0.0f,0.980581f}, {-0.290194f,-0.0709971f,0.954331f},{-0.907873f,-0.419245f,0.0f},{-0.196093f,0.000484212f,0.980585f}, {-0.195953f,0.00012107f,0.980613f},{2.29249e-07f,0.384615f,0.923077f},{1.52832e-07f,0.384615f,0.923077f}, {1.52832e-07f,0.384615f,0.923077f},{1.77707e-07f,0.447214f,-0.894427f},{1.77707e-07f,0.447214f,-0.894427f}, {2.6656e-07f,0.447214f,-0.894427f},{-0.151174f,0.988507f,1.50429e-08f},{-0.189108f,0.981956f,0.0f}, {0.999991f,-0.00166673f,-0.00400015f},{-0.371391f,0.928477f,2.46373e-08f},{-0.371391f,0.928477f,0.0f}, {-0.371391f,0.928477f,-1.83859e-08f},{-0.371391f,0.928477f,-2.45145e-08f},{0.980392f,-0.197059f,0.0f}, {0.995037f,-0.0995037f,0.0f},{0.676879f,-0.272789f,0.683682f},{0.402982f,-0.104933f,0.909172f}, {0.57475f,-0.155807f,0.80336f},{0.6928f,-0.174244f,0.699763f},{0.325197f,-0.259832f,0.909249f}, {0.376161f,-0.300552f,-0.876454f},{0.43467f,-0.142799f,-0.889197f},{-0.970143f,-0.242536f,0.0f}, {-0.894427f,-0.447214f,0.0f},{-0.346729f,-0.3476f,0.871179f},{0.664818f,-0.334071f,-0.668142f}, {-0.474089f,-0.393761f,-0.787523f},{-0.390405f,0.120046f,0.912783f},{-0.514496f,0.0f,0.857493f}, {-0.313611f,-0.0965199f,0.944633f},{0.446856f,0.00014884f,0.894606f},{-0.813733f,-0.581238f,0.0f}, {-0.371391f,0.928477f,0.0f},{-0.371391f,0.928477f,0.0f},{-0.189108f,0.981956f,-1.24825e-08f}, {-0.371391f,0.928477f,0.0f},{-0.36905f,-0.139388f,0.918898f},{-0.373724f,-0.141039f,0.916754f}, {-0.365052f,-0.138626f,0.920609f},{-0.000999986f,-0.000714276f,0.999999f},{-0.00199997f,0.0f,0.999998f}, {-0.368134f,-0.0916506f,0.925245f},{0.445321f,-0.0668865f,0.892869f},{-0.373184f,-0.0023176f,0.927755f}, {-0.373782f,-0.00309013f,0.927512f},{-0.370589f,-0.00232121f,0.928794f},{-0.369788f,0.0f,0.929116f}, {0.448659f,0.000900237f,0.893703f},{-0.0377794f,0.418825f,0.907281f},{0.212497f,0.407234f,0.88826f}, {-0.26856f,0.456816f,0.848053f},{-0.516797f,0.363308f,0.775195f},{0.412685f,0.275124f,0.86833f}, {-0.707107f,0.0f,-0.707107f},{-0.707107f,7.02447e-08f,-0.707107f},{-0.707107f,1.05367e-07f,-0.707107f}, {-0.705011f,-0.0769292f,-0.705012f},{-0.698687f,-0.153859f,-0.698687f},{0.694988f,-0.174225f,-0.697594f}, {0.694561f,-0.174161f,-0.698035f},{0.999993f,-0.00166673f,0.00333347f},{-0.000999986f,-0.000714276f,-0.999999f}, {-0.00199997f,0.0f,-0.999998f},{-0.195953f,0.00012107f,-0.980613f},{-0.196093f,0.000484212f,-0.980585f}, {-0.196116f,0.0f,-0.980581f},{-0.360828f,0.000610285f,-0.932632f},{-0.196116f,0.0f,-0.980581f}, {-0.360597f,0.0f,-0.932722f},{-0.360948f,0.00103619f,-0.932585f},{-0.360269f,-9.57201e-05f,-0.932848f}, {-0.195427f,-0.000188624f,-0.980718f},{-0.357716f,-0.107468f,-0.927626f},{-0.50445f,-0.210072f,-0.837496f}, {-0.505142f,-0.210302f,-0.837022f},{-0.503446f,-0.209886f,-0.838147f},{-0.51163f,-0.105392f,-0.852717f}, {0.705322f,-0.0582042f,-0.706494f},{0.706472f,-0.00022086f,-0.707741f},{0.706224f,0.0f,-0.707989f}, {0.70672f,-0.000441721f,-0.707493f},{-0.515126f,0.0f,-0.857114f},{-0.514951f,0.000476285f,-0.85722f}, {-0.514496f,0.0f,-0.857493f},{0.707107f,0.0f,-0.707107f},{-0.514496f,2.43384e-09f,-0.857493f}, {-0.514496f,6.63775e-10f,-0.857493f},{0.706665f,0.000135819f,-0.707548f},{-0.688247f,-0.229416f,-0.688247f}, {-0.688247f,-0.229416f,-0.688247f},{-0.688247f,-0.229416f,-0.688247f} }; GLfloat textures[1][2]={{0.0f,0.0f}}; /*Material indicies*/ /*{material index,face count}*/ static int material_ref [200][2] = { {0,1}, {1,1}, {0,1}, {1,2}, {2,1}, {1,1}, {2,1}, {1,3}, {2,1}, {1,14}, {3,3}, {1,3}, {3,1}, {1,9}, {3,1}, {1,1}, {3,2}, {1,2}, {3,1}, {1,2}, {3,1}, {1,4}, {3,1}, {0,1}, {4,4}, {1,5}, {4,2}, {1,3}, {4,4}, {1,2}, {4,5}, {1,4}, {4,3}, {1,1}, {4,3}, {1,1}, {4,2}, {1,11}, {3,3}, {1,1}, {3,1}, {1,6}, {2,1}, {1,2}, {3,1}, {1,1}, {3,1}, {1,4}, {3,2}, {1,4}, {2,1}, {3,3}, {1,2}, {3,1}, {1,1}, {0,2}, {1,2}, {0,2}, {1,2}, {0,8}, {1,1}, {4,1}, {5,2}, {0,1}, {1,2}, {3,1}, {1,1}, {0,1}, {1,2}, {0,1}, {1,5}, {4,2}, {1,32}, {3,1}, {1,1}, {3,1}, {1,7}, {3,1}, {1,3}, {3,1}, {1,4}, {4,3}, {1,1}, {4,1}, {1,4}, {4,8}, {1,2}, {4,4}, {1,2}, {4,5}, {0,1}, {4,1}, {1,2}, {3,3}, {1,4}, {3,1}, {1,3}, {3,2}, {1,6}, {4,2}, {3,3}, {1,7}, {3,1}, {1,5}, {3,6}, {1,1}, {0,1}, {1,2}, {0,2}, {1,2}, {0,10}, {5,5}, {0,2}, {5,1}, {0,8}, {1,1}, {0,1}, {1,1}, {0,1}, {1,1}, {3,4}, {1,10}, {3,1}, {1,1}, {3,3}, {1,1}, {3,1}, {1,1}, {3,3}, {1,4}, {4,18}, {1,15}, {4,2}, {0,1}, {4,3}, {1,1}, {4,5}, {3,1}, {1,1}, {3,1}, {1,3}, {3,1}, {1,8}, {3,5}, {1,3}, {3,1}, {1,1}, {3,1}, {1,14}, {4,1}, {1,1}, {4,1}, {1,2}, {4,3}, {1,1}, {4,1}, {0,1}, {1,4}, {0,2}, {1,2}, {0,2}, {1,3}, {0,1}, {1,3}, {0,1}, {1,4}, {3,1}, {1,2}, {0,3}, {3,1}, {1,1}, {3,1}, {1,3}, {4,3}, {1,1}, {4,1}, {1,1}, {4,4}, {0,1}, {1,3}, {3,3}, {1,2}, {3,1}, {1,10}, {3,3}, {1,2}, {0,1}, {1,1}, {0,1}, {1,4}, {3,1}, {1,10}, {2,1}, {1,7}, {0,2}, {1,2}, {0,2}, {1,2}, {0,2}, {1,2} }; float sizex,sizey; LONG WINAPI WndProc (HWND, UINT, WPARAM, LPARAM); GLsizei glnWidth, glnHeight; GLdouble gldAspect; void SetDCPixelFormat (HWND,HDC); void InitializeRC (void); void DrawScene (HDC, UINT,UINT); HPALETTE hPalette = NULL; GLfloat nSize = 0.0f; GLfloat nCol = 0.0f; GLfloat nTop = 1.0f; GLfloat nBottom = 0.0f; int bFlag = 1; char wndname[256]=""; int WINAPI WinMain (HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpszCmdLine, int nCmdShow) { static char szAppName[] = "3D Exploration Exported APP"; WNDCLASS wc; HWND hwnd; MSG msg; wc.style = CS_HREDRAW | CS_VREDRAW; wc.lpfnWndProc = (WNDPROC) WndProc; wc.cbClsExtra = 0; wc.cbWndExtra = 0; wc.hInstance = hInstance; wc.hIcon = LoadIcon (NULL, IDI_APPLICATION); wc.hCursor = LoadCursor (NULL, IDC_ARROW); wc.hbrBackground = (HBRUSH) (COLOR_WINDOW + 1); wc.lpszMenuName = NULL; wc.lpszClassName = szAppName; RegisterClass (&wc); hwnd = CreateWindow (szAppName, szAppName, WS_OVERLAPPEDWINDOW | WS_CLIPCHILDREN | WS_CLIPSIBLINGS, CW_USEDEFAULT, CW_USEDEFAULT, 200, 200, HWND_DESKTOP, NULL, hInstance, NULL); ShowWindow (hwnd, nCmdShow); UpdateWindow (hwnd); while (GetMessage (&msg, NULL, 0, 0)) { TranslateMessage (&msg); DispatchMessage (&msg); } return msg.wParam; } /* * WndProc processes messages to the main window. */ LONG WINAPI WndProc (HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam) { static HDC hdc; static HGLRC hrc; PAINTSTRUCT ps; static UINT nAngle = 0; static UINT nAngle2 = 0; static UINT nTimer; int n; switch (msg) { case WM_CREATE: // // Create a rendering context and set a timer. // hdc = GetDC (hwnd); SetDCPixelFormat (hwnd,hdc); hrc = wglCreateContext (hdc); wglMakeCurrent (hdc, hrc); InitializeRC (); nTimer = SetTimer (hwnd, 1, 1, NULL); return 0; case WM_SIZE: // // Redefine the viewing volume and viewport when the window size // changes. // glnWidth = (GLsizei) LOWORD (lParam); glnHeight = (GLsizei) HIWORD (lParam); return 0; case WM_PAINT:{ // // Draw the scene. // BeginPaint (hwnd, &ps); DrawScene (hdc, nAngle,nAngle2); EndPaint (hwnd, &ps); }return 0; case WM_TIMER: // // Update the rotation angle and force a repaint. // nAngle += 2; if (nAngle >= 360) nAngle -= 360; nAngle2 += 1; if (nAngle2 >= 360) nAngle2 -= 360; if (bFlag == 1) nSize += 0.05f; nCol += 0.01f; if (nSize >= nTop) bFlag = 0; if (bFlag == 0) nSize -= 0.05f; nCol -= 0.01f; if (nSize <= nBottom) bFlag = 1; InvalidateRect (hwnd, NULL, FALSE); return 0; case WM_QUERYNEWPALETTE: // // If the program is using a color palette, realize the palette // and update the client area when the window receives the input // focus. // if (hPalette != NULL) { if (n = RealizePalette (hdc)) InvalidateRect (hwnd, NULL, FALSE); return n; } break; case WM_PALETTECHANGED: // // If the program is using a color palette, realize the palette // and update the colors in the client area when another program // realizes its palette. // if ((hPalette != NULL) && ((HWND) wParam != hwnd)) { if (RealizePalette (hdc)) UpdateColors (hdc); return 0; } break; case WM_DESTROY: // // Clean up and terminate. // wglMakeCurrent (NULL, NULL); wglDeleteContext (hrc); ReleaseDC (hwnd, hdc); if (hPalette != NULL) DeleteObject (hPalette); KillTimer (hwnd, nTimer); PostQuitMessage (0); return 0; } return DefWindowProc (hwnd, msg, wParam, lParam); } /* * SetDCPixelFormat sets the pixel format for a device context in * preparation for creating a rendering context. * * Input parameters: * hdc = Device context handle * * Returns: * Nothing */ void SetDCPixelFormat (HWND hwnd,HDC hdc) { HANDLE hHeap; int nColors, i; LPLOGPALETTE lpPalette; BYTE byRedMask, byGreenMask, byBlueMask; static PIXELFORMATDESCRIPTOR pfd = { sizeof (PIXELFORMATDESCRIPTOR), // Size of this structure 1, // Version number PFD_DRAW_TO_WINDOW | // Flags PFD_SUPPORT_OPENGL | PFD_GENERIC_ACCELERATED| PFD_DOUBLEBUFFER, PFD_TYPE_RGBA, // RGBA pixel values 24, // 24-bit color 0, 0, 0, 0, 0, 0, // Don''t care about these 0, 0, // No alpha buffer 0, 0, 0, 0, 0, // No accumulation buffer 32, // 32-bit depth buffer 0, // No stencil buffer 0, // No auxiliary buffers PFD_MAIN_PLANE, // Layer type 0, // Reserved (must be 0) 0, 0, 0 // No layer masks }; int nPixelFormat; nPixelFormat = ChoosePixelFormat (hdc, &pfd); SetPixelFormat (hdc, nPixelFormat, &pfd); if (pfd.dwFlags & PFD_NEED_PALETTE) { nColors = 1 << pfd.cColorBits; hHeap = GetProcessHeap (); (LPLOGPALETTE) lpPalette = (LPLOGPALETTE)HeapAlloc (hHeap, 0, sizeof (LOGPALETTE) + (nColors * sizeof (PALETTEENTRY))); lpPalette->palVersion = 0x300; lpPalette->palNumEntries = nColors; byRedMask = (1 << pfd.cRedBits) - 1; byGreenMask = (1 << pfd.cGreenBits) - 1; byBlueMask = (1 << pfd.cBlueBits) - 1; for (i=0; ipalPalEntry.peRed = (((i >> pfd.cRedShift) & byRedMask) * 255) / byRedMask; lpPalette->palPalEntry[i].peGreen = (((i >> pfd.cGreenShift) & byGreenMask) * 255) / byGreenMask; lpPalette->palPalEntry[i].peBlue = (((i >> pfd.cBlueShift) & byBlueMask) * 255) / byBlueMask; lpPalette->palPalEntry[i].peFlags = 0; } hPalette = CreatePalette (lpPalette); HeapFree (hHeap, 0, lpPalette); if (hPalette != NULL) { SelectPalette (hdc, hPalette, FALSE); RealizePalette (hdc); } } } /* * InitializeRC initializes the current rendering context. * * Input parameters: * None * * Returns: * Nothing */ void InitializeRC (void) { GLfloat glfLightAmbient[] = { 0.1f, 0.1f, 0.1f, 1.0f }; GLfloat glfLightDiffuse[] = { 1.2f, 1.2f, 1.2f, 1.0f }; GLfloat glfLightSpecular[] = { 0.9f, 0.9f, 0.9f, 1.0f }; // // Add a light to the scene. // glLightfv (GL_LIGHT0, GL_AMBIENT, glfLightAmbient); glLightfv (GL_LIGHT0, GL_DIFFUSE, glfLightDiffuse); glLightfv (GL_LIGHT0, GL_SPECULAR, glfLightSpecular); glEnable (GL_LIGHTING); glEnable (GL_LIGHT0); // // Enable depth testing and backface culling. // glEnable (GL_DEPTH_TEST); glEnable (GL_CULL_FACE); } void MyMaterial(GLenum mode,GLfloat *f,GLfloat alpha) { GLfloat d[4]; d[0]=f[0]; d[1]=f[1]; d[2]=f[2]; d[3]=alpha; glMaterialfv (GL_FRONT_AND_BACK,mode,d); } /* * SelectMaterial uses OpenGL commands to define facet colors. * * Returns: * Nothing */ void SelectMaterial(int i) { // // Define the reflective properties of the 3D Object faces. // glEnd(); GLfloat alpha=materials[i].alpha; MyMaterial (GL_AMBIENT, materials[i].ambient,alpha); MyMaterial (GL_DIFFUSE, materials[i].diffuse,alpha); MyMaterial (GL_SPECULAR, materials[i].specular,alpha); MyMaterial (GL_EMISSION, materials[i].emission,alpha); glMaterialf (GL_FRONT_AND_BACK,GL_SHININESS,materials[i].phExp); glBegin(GL_TRIANGLES); } /* * DrawScene uses OpenGL commands to draw a object. * * Input parameters: * hdc = Device context handle * nAngle = Angle of rotation for object * * Returns: * Nothing */ void DrawScene (HDC hdc, UINT nAngle,UINT nAngle2) { sizex=glnWidth; sizey=glnHeight; gldAspect = (GLdouble) glnWidth / (GLdouble) glnHeight; glMatrixMode (GL_PROJECTION); glLoadIdentity (); gluPerspective (30.0, // Field-of-view angle gldAspect, // Aspect ratio of viewing volume 1.0, // Distance to near clipping plane 10.0); // Distance to far clipping plane glViewport (0, 0, glnWidth, glnHeight); // // Clear the color and depth buffers. // glClear (GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); // // Define the modelview transformation. // glMatrixMode (GL_MODELVIEW); glLoadIdentity (); glTranslatef (0.0f, 0.0f, -8.0f); glRotatef (30.0f, 1.0f, 0.0f, 0.0f); glRotatef ((GLfloat) nAngle, 0.0f, 1.0f, 0.0f); glRotatef ((GLfloat) nAngle2, 1.0f, 0.0f, 0.0f); glScalef (nSize+2.5f,nSize+2.5f,nSize+2.5f); int mcount=0; int mindex=0; glBegin (GL_TRIANGLES); for(int i=0;i

Share this post


Link to post
Share on other sites
You don''t create any textures or bind them when you render the model.

Load textures into materials.texture (where i is the material index). Don''t forget to enable texture mapping glEnable(GL_TEXTURE_2D). Don''t forget to bind texture in SelectMaterial glBindTexture(materials[i].texture).

Share this post


Link to post
Share on other sites
Thanks for your help `TheGilb`,

I''m sorry to say that I don''t understand what your trying to tell me. I''m fairly new to OpenGL and have been using GLUT to get me going. When you compile and run the code shown above the object renders correctly (model data and model materials). I''m trying to use the object data within a GLUT framework. You mention binding the textures (bind texture in SelectMaterial glBindTexture(materials.texture). ) I can''t see the above program doing that and it works correctly.

Please help some more. I just don''t understand it.!!!!!!


cheers again,
a total newbie.


Share this post


Link to post
Share on other sites
Guest Anonymous Poster
Are you insane? What are you doing posting that big ass code? At least, you could of cut the data off by a few hundred lines.

Glut is only a FRAMEWORK. You just copy the render parts, and the data. Then it should do the same.

Look at some other glut samples and replace the render code with the code that renders in that post of yours.



Share this post


Link to post
Share on other sites
A little advice, don't use their code export. Horrible way to do things. You should save it as a RAW triangle file and load it yourself. I reccommend something like this.
    
typedef struct
{
GLfloat v1[3], v2[3], v3[3];
}triangle;

void main()
{
apvector<triangle> tris;
ifstream file;
file.open("model.raw");
int poly=0;
char temp[100];

//Read Entire File

while(!file.eof())
{
poly++;
tris.resize(poly);
//Load Vertex 1

file>>temp;
tris[poly-1].v1[0] = atof(temp);
file>>temp;
tris[poly-1].v1[1] = atof(temp);
file>>temp;
tris[poly-1].v1[2] = atof(temp);
//Load Vertex 2

file>>temp;
tris[poly-1].v2[0] = atof(temp);
file>>temp;
tris[poly-1].v2[1] = atof(temp);
file>>temp;
tris[poly-1].v2[2] = atof(temp);
//Load Vertex 3

file>>temp;
tris[poly-1].v3[0] = atof(temp);
file>>temp;
tris[poly-1].v3[1] = atof(temp);
file>>temp;
tris[poly-1].v3[2] = atof(temp);
}
}


Note that this code will not work unless you go through your raw model file and remove the mesh names. Just a suggestion for quick model loading. Though unfortunately this does not give you texture coordinates. It's just the easiest way to load a model. Not the most functional, but the easiest. The file open code may be wrong, I can't quite remember right now. You can use a different model format that has texture coordinates, it'll just be a tiny bit more work.

Alex Broadwin
A-Tronic Software & Design
-----
"if you fail in life, you were destined to fail. If you suceed in life, call me."
"The answer is out there."
"Please help, I'm using Windows!"

Edited by - ATronic on November 10, 2001 6:02:06 PM

Share this post


Link to post
Share on other sites