利⽤3D Exploring把模型變成cpp檔 Export Type 要改成Sample APP
2. Create new OpenGL projrct
3. 把main.c改成main.cpp
4. 把剛剛匯出的程式碼貼進去 5. 並稍微更改程式,讓他可以跑起來
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 <windows.h>
#include <GL\gl.h>
#include <GL\glu.h>
#include <math.h>
struct sample_MATERIAL{
GLfloat ambient[3];
GLfloat diffuse[3];
GLfloat specular[3];
GLfloat emission[3];
GLfloat alpha;
GLfloat phExp;
int texture;
};
struct sample_TEXTURE{
char * name;
GLint id;
};
//static sample_MATERIAL materials [1] = {
// {{1.0f,1.0f,1.0f}, {1.0f,1.0f,1.0f}, {1.0f,1.0f,1.0f}, {1.0f,1.0f,1.0f}, 1.0f,8.0f,0} //lambert10SG
//};
//static sample_TEXTURE texture_maps [1] = {
//{"gundan_openGL_0.bmp",0}
//};
// 7558 Verticies
// 6642 Texture Coordinates
// 11913 Normals
// 13870 Triangles
static short face_indicies[13870][9] = {
// polySurface666
{8,2,3 ,0,1,2 ,0,1,2 }, {8,1,2 ,0,3,1 ,3,4,5 }, {0,1,8 ,4,3,0 ,6,4,3 },
{10,11,9 ,5,5,5 ,7,8,9 }, {16,15,14 ,6,7,8 ,10,2,1 }, {16,14,13 ,6,8,9 ,11,12,13 },
{12,16,13 ,10,6,9 ,14,11,13 }, {18,17,19 ,11,11,11 ,7,9,8 },
{29,86,25 ,12,13,14 ,15,16,17 }, {29,84,32 ,12,15,16 ,15,18,19 },
{33,34,36 ,17,18,19 ,20,21,22 }, {39,38,40 ,20,21,22 ,23,24,25 },
{38,33,35 ,21,17,23 ,24,20,26 }, {39,90,37 ,20,24,25 ,23,27,28 },
{36,42,44 ,19,26,27 ,22,29,30 }, {35,36,43 ,23,19,28 ,26,22,31 },
{46,47,40 ,29,30,22 ,32,33,25 }, {39,47,90 ,20,30,24 ,23,33,27 },
{32,84,55 ,16,15,31 ,19,18,34 }, {58,95,57 ,32,33,34 ,35,36,37 },
{50,59,60 ,35,36,37 ,38,39,40 }, {60,61,50 ,37,38,35 ,40,41,38 },
{65,54,63 ,39,40,41 ,42,43,44 }, {68,60,66 ,42,37,43 ,45,40,46 },
{69,62,68 ,44,45,42 ,47,48,45 }, {70,63,69 ,46,41,44 ,49,44,47 },
{73,32,64 ,47,16,48 ,50,19,51 }, {30,76,41 ,49,50,51 ,52,53,54 },
{42,36,34 ,26,19,18 ,29,22,21 }, {30,88,76 ,49,52,50 ,52,55,53 },
{51,52,43 ,53,54,28 ,56,57,31 }, {64,32,55 ,48,16,31 ,51,19,34 },
{77,66,67 ,55,56,57 ,58,59,60 }, {77,121,78 ,55,58,59 ,58,61,62 },
{69,75,70 ,60,61,62 ,63,64,65 }, {75,69,68 ,61,60,63 ,64,63,66 },
{71,74,73 ,64,65,66 ,67,68,69 }, {74,71,72 ,65,64,67 ,68,67,70 },
{74,56,73 ,65,68,66 ,68,71,69 }, {55,85,47 ,31,69,30 ,34,72,33 },
{27,84,26 ,70,15,71 ,73,18,74 }, {55,84,28 ,31,15,72 ,34,18,75 },
{27,28,84 ,70,72,15 ,73,75,18 }, {55,28,85 ,31,72,69 ,34,75,72 },
{29,24,86 ,12,73,13 ,15,76,16 }, {58,24,29 ,32,73,12 ,35,76,15 },
{58,23,24 ,32,74,73 ,35,77,76 }, {21,22,88 ,75,76,52 ,78,79,55 },
{20,30,87 ,77,49,78 ,80,52,81 }, {30,20,88 ,49,77,52 ,52,80,55 },
{87,30,31 ,78,49,79 ,81,52,82 }, {58,48,88 ,32,80,52 ,35,83,55 },
{76,88,89 ,50,52,81 ,53,55,84 }, {89,88,48 ,81,52,80 ,84,55,83 },
{88,20,21 ,52,77,75 ,55,80,78 }, {37,90,41 ,25,24,51 ,28,27,54 },
{90,47,31 ,24,30,79 ,27,33,82 }, {90,31,30 ,24,79,49 ,27,82,52 },
{41,90,30 ,51,24,49 ,54,27,52 }, {47,85,31 ,30,69,79 ,33,72,82 },
{40,47,39 ,22,30,20 ,25,33,23 }, {37,38,39 ,25,21,20 ,28,24,23 },
{35,43,45 ,23,28,82 ,26,31,85 }, {38,35,40 ,21,23,22 ,24,26,25 },
{36,44,43 ,19,27,28 ,22,30,31 }, {33,36,35 ,17,19,23 ,20,22,26 },
{58,57,94 ,32,34,83 ,35,37,86 }, {91,92,93 ,84,85,86 ,87,88,89 },
{63,54,53 ,41,40,87 ,44,43,90 }, {69,63,62 ,44,41,45 ,47,44,48 },
{68,62,61 ,42,45,38 ,45,48,41 }, {68,61,60 ,42,38,37 ,45,41,40 },
{50,61,51 ,35,38,53 ,38,41,56 }, {50,51,44 ,35,53,27 ,38,56,30 },
{44,49,50 ,27,88,35 ,30,91,38 }, {49,59,50 ,88,36,35 ,91,39,38 },
{44,51,43 ,27,53,28 ,30,56,31 }, {42,49,44 ,26,88,27 ,29,91,30 },
{73,64,71 ,47,48,89 ,50,51,92 }, {94,57,91 ,83,34,84 ,86,37,87 },
{58,94,48 ,32,83,80 ,35,86,83 }, {95,58,29 ,33,32,12 ,36,35,15 },
{73,96,32 ,47,90,16 ,50,93,19 }, {96,73,56 ,91,66,68 ,94,69,71 },
{92,95,97 ,85,33,92 ,88,36,95 }, {95,96,97 ,33,90,92 ,36,93,95 },
{97,96,98 ,92,90,93 ,95,93,96 }, {95,92,57 ,33,85,34 ,36,88,37 },
{92,91,57 ,85,84,34 ,88,87,37 }, {37,41,117 ,94,95,96 ,97,98,99 },
{59,49,120 ,97,98,99 ,100,101,102 }, {77,67,121 ,55,57,58 ,58,60,61 },
{78,121,122 ,59,58,100 ,62,61,103 }, {67,123,121 ,101,102,103 ,104,105,106 },
{59,120,123 ,97,99,102 ,100,102,105 }, {67,59,123 ,101,97,102 ,104,100,105 },
{152,159,160 ,104,105,106 ,107,108,109 }, {151,162,159 ,107,108,105 ,110,111,108 },
{153,152,160 ,109,104,106 ,112,107,109 }, {152,151,159 ,104,107,105 ,107,110,108 },
{133,126,163 ,110,111,112 ,113,114,115 }, {126,190,168 ,111,113,114 ,114,116,117 },
{163,189,169 ,112,115,116 ,115,118,119 }, {164,188,170 ,117,118,119 ,120,121,122 },
{165,187,171 ,120,121,122 ,123,124,125 }, {156,185,180 ,123,124,125 ,126,127,128 },
{162,156,180 ,126,123,125 ,111,126,128 }, {157,166,181 ,127,128,129 ,129,130,131 },
{181,166,184 ,129,128,130 ,131,130,132 }, {173,41,76 ,131,51,50 ,133,134,135 },
{184,186,222 ,132,133,134 ,136,137,138 }, {192,191,223 ,135,136,137 ,139,140,141 },
{196,195,225 ,138,139,140 ,142,143,144 }, {198,197,226 ,141,142,143 ,145,146,147 },
{193,225,194 ,144,140,145 ,148,144,149 }, {193,196,225 ,144,138,140 ,148,142,144 },
{249,227,234 ,146,147,148 ,150,151,152 }, {222,232,242 ,134,149,150 ,138,153,154 },
{234,233,246 ,151,152,153 ,155,156,157 }, {235,246,247 ,154,153,155 ,158,157,159 },
{237,235,247 ,156,154,155 ,160,158,159 }, {238,237,247 ,157,156,155 ,161,160,159 },
{244,247,243 ,158,155,159 ,162,159,163 }, {239,238,245 ,160,157,161 ,164,161,165 },
{235,234,246 ,154,151,153 ,158,155,157 }, {89,48,236 ,162,163,164 ,84,83,166 },
{76,89,236 ,165,162,164 ,53,84,166 }, {250,94,251 ,166,167,168 ,167,86,168 },
{48,250,236 ,163,166,164 ,83,167,166 }, {48,94,250 ,163,167,166 ,83,86,167 },
{91,93,251 ,169,170,168 ,87,89,168 }, {251,94,91 ,168,167,169 ,168,86,87 },
{185,179,252 ,171,172,173 ,169,170,171 }, {179,182,252 ,172,174,173 ,170,172,171 },
{180,185,252 ,175,171,173 ,173,169,171 }, {199,183,253 ,176,177,178 ,174,175,176 },
{200,199,253 ,179,176,178 ,177,174,176 }, {262,255,261 ,180,181,182 ,178,179,180 },
{260,258,263 ,183,184,185 ,181,182,183 }, {236,262,294 ,186,180,187 ,184,185,186 },
{257,260,266 ,188,183,189 ,187,181,188 }, {260,267,266 ,183,190,189 ,189,190,191 },
{271,266,267 ,191,189,192 ,192,191,190 }, {268,264,269 ,193,194,195 ,193,194,195 },
{268,269,272 ,193,195,196 ,193,195,196 }, {268,274,278 ,193,197,198 ,193,197,198 },
{267,296,277 ,192,199,200 ,190,199,200 }, {278,274,279 ,198,197,201 ,198,197,201 },
{268,272,274 ,193,196,197 ,193,196,197 }, {257,266,295 ,188,189,202 ,187,188,202 },
{284,297,299 ,203,204,205 ,203,204,205 }, {278,281,285 ,198,206,207 ,198,206,207 },
{278,279,281 ,198,201,206 ,198,201,206 }, {285,281,298 ,207,206,208 ,207,206,208 },
{297,285,298 ,204,207,208 ,204,207,208 }, {298,299,297 ,208,205,204 ,208,205,204 },
{299,298,300 ,209,210,210 ,205,208,209 }, {281,302,298 ,211,212,212 ,206,210,208 },
{300,298,302 ,213,212,212 ,209,208,210 }, {302,306,307 ,214,215,216 ,211,212,213 },
{302,281,301 ,217,218,219 ,210,206,214 }, {252,247,310 ,220,221,222 ,171,215,216 },
{253,252,310 ,223,220,222 ,176,171,216 }, {254,253,310 ,224,223,222 ,217,176,216 },
{22,21,311 ,76,225,226 ,79,78,218 }, {23,22,311 ,74,76,226 ,77,79,218 },
{24,23,311 ,73,74,227 ,76,77,218 }, {25,86,311 ,228,13,227 ,17,16,218 },
{26,25,311 ,229,228,227 ,74,17,218 }, {27,26,311 ,230,229,227 ,73,74,218 },
{28,27,311 ,231,230,227 ,75,73,218 }, {31,85,311 ,232,232,232 ,82,72,218 },
{85,28,311 ,233,233,233 ,72,75,218 }, {86,24,311 ,13,73,227 ,16,76,218 },
{21,20,311 ,225,234,226 ,78,80,218 }, {20,87,311 ,234,235,235 ,80,81,218 },
{87,31,311 ,235,236,235 ,81,82,218 }, {240,243,247 ,237,237,237 ,219,163,159 },
{299,300,302 ,238,238,238 ,220,221,222 }, {302,312,310 ,239,240,222 ,222,223,216 },

沒有留言:
張貼留言