想学OpenGL...想找点源代码!最好不用控件的!!!(100分)

  • 主题发起人 主题发起人 zh.y.s
  • 开始时间 开始时间
Z

zh.y.s

Unregistered / Unconfirmed
GUEST, unregistred user!
最好是有三维的数据,调用后生成三维图形!!!!!!
 
哈哈!又是你!不过这次我不会给你了!上次的分给我太少了!哈哈!
三维数据,生成三维图形!哈哈!代码多得是!
自己做一点不就行了吗?哈哈!
 
听听看!
 
到http://www.delphi-gems.com/Graphics.php#OpenGL12下载一个openGL头文件,
这里面有个示例,直接在form上面输出图形,没用任何控件。
 
品雪其寒,卷起千堆雪的有不少呢
 
三维数据:
unit face_data;

interface

const numVertices = 473;
numNormals = 537;
numTriangles = 806;

{ vert1, vert2, vert3, norm1, norm2, norm3 }
const Face : Array[0..805, 0..5] of Integer = (
(2,1,0 ,0,1,2 ), (3,1,2 ,3,1,0 ), (6,5,4 ,4,5,6 ), (4,7,6 ,6,7,4 ),
(8,6,7 ,8,4,7 ), (7,9,8 ,7,9,8 ), (8,9,10 ,8,9,10 ), (11,8,10 ,11,8,10 ),
(12,11,10 ,12,11,10 ), (1,12,10 ,1,12,10 ), (13,1,10 ,13,1,10 ),
(9,13,10 ,14,13,10 ), (0,1,13 ,2,1,13 ), (14,0,13 ,15,16,17 ),
(15,14,13 ,18,15,17 ), (9,16,15 ,14,19,18 ), (15,13,9 ,18,17,14 ),
(17,16,9 ,20,21,9 ), (9,7,17 ,9,7,20 ), (18,17,7 ,22,20,7 ),
(7,4,18 ,7,6,22 ), (19,14,15 ,23,15,18 ), (20,14,19 ,24,25,23 ),
(19,21,20 ,23,26,24 ), (22,20,21 ,27,24,26 ), (21,23,22 ,26,28,27 ),
(24,22,23 ,29,27,28 ), (23,25,24 ,28,30,29 ), (26,24,25 ,31,29,30 ),
(25,27,26 ,30,32,31 ), (28,26,27 ,33,31,32 ), (28,29,26 ,33,34,31 ),
(31,30,29 ,35,36,34 ), (32,29,30 ,37,34,36 ), (33,1,3 ,38,1,3 ),
(12,1,33 ,12,1,38 ), (34,33,3 ,39,38,3 ), (3,35,34 ,3,40,39 ),
(36,34,35 ,41,39,40 ), (35,32,36 ,40,37,41 ), (30,36,32 ,36,41,37 ),
(31,37,30 ,35,42,36 ), (37,38,30 ,42,43,36 ), (38,36,30 ,43,41,36 ),
(39,36,38 ,44,41,43 ), (34,36,39 ,39,41,44 ), (40,33,34 ,45,38,39 ),
(40,41,33 ,45,46,38 ), (34,39,40 ,39,44,45 ), (41,12,33 ,46,12,38 ),
(42,12,41 ,47,12,46 ), (44,43,8 ,48,49,8 ), (8,11,44 ,8,11,48 ),
(42,44,11 ,47,48,11 ), (11,12,42 ,11,12,47 ), (42,45,44 ,47,50,48 ),
(46,45,42 ,51,50,47 ), (47,45,46 ,52,50,51 ), (42,41,46 ,47,46,51 ),
(48,46,41 ,53,51,46 ), (41,49,48 ,54,55,53 ), (50,49,41 ,56,57,46 ),
(41,51,50 ,46,58,56 ), (52,51,41 ,59,58,46 ), (54,53,52 ,60,61,59 ),
(52,40,54 ,59,45,60 ), (41,40,52 ,46,45,59 ), (50,55,49 ,56,62,57 ),
(51,55,50 ,58,62,56 ), (56,49,55 ,63,57,62 ), (57,49,56 ,64,55,63 ),
(8,43,58 ,8,49,65 ), (58,6,8 ,65,4,8 ), (58,59,5 ,65,66,5 ),
(5,6,58 ,5,4,65 ), (61,60,59 ,67,68,66 ), (59,58,61 ,66,65,67 ),
(62,61,58 ,69,67,65 ), (58,43,62 ,65,49,69 ), (44,62,43 ,48,69,49 ),
(45,62,44 ,50,69,48 ), (63,62,45 ,70,69,50 ), (47,64,63 ,52,71,70 ),
(63,45,47 ,70,50,52 ), (61,62,63 ,67,69,70 ), (63,65,61 ,70,72,67 ),
(48,49,57 ,53,55,64 ), (57,66,48 ,64,73,53 ), (67,48,66 ,74,53,73 ),
(46,48,67 ,51,53,74 ), (47,67,68 ,75,74,76 ), (46,67,47 ,51,74,75 ),
(69,64,47 ,77,71,75 ), (47,68,69 ,75,76,77 ), (64,69,70 ,71,78,79 ),
(70,71,64 ,79,80,71 ), (73,72,71 ,81,82,80 ), (71,70,73 ,80,79,81 ),
(74,72,73 ,83,82,81 ), (75,56,74 ,84,63,83 ), (75,57,56 ,84,64,63 ),
(74,73,75 ,83,81,84 ), (76,60,61 ,85,68,67 ), (61,65,76 ,67,72,86 ),
(64,77,65 ,71,87,72 ), (65,63,64 ,72,70,71 ), (77,76,65 ,87,85,72 ),
(78,76,77 ,88,89,87 ), (77,71,78 ,87,80,88 ), (77,64,71 ,87,71,80 ),
(79,78,71 ,90,88,80 ), (71,72,79 ,80,82,90 ), (74,79,72 ,83,90,82 ),
(80,79,74 ,91,90,83 ), (74,81,80 ,83,92,91 ), (56,82,81 ,63,93,92 ),
(81,74,56 ,92,83,63 ), (55,82,56 ,62,93,63 ), (84,83,80 ,94,95,96 ),
(80,81,84 ,96,92,94 ), (85,84,81 ,97,94,92 ), (81,82,85 ,92,93,97 ),
(55,85,82 ,62,97,93 ), (86,85,55 ,98,97,62 ), (55,87,86 ,62,99,98 ),
(51,87,55 ,58,99,62 ), (88,87,51 ,100,99,58 ), (51,52,88 ,58,59,100 ),
(52,89,88 ,59,101,100 ), (53,89,52 ,61,101,59 ), (90,89,53 ,102,101,61 ),
(89,90,91 ,101,103,103 ), (88,89,91 ,104,101,104 ), (90,92,91 ,102,105,106 ),
(95,94,93 ,107,108,109 ), (96,93,94 ,110,109,108 ), (94,97,96 ,108,111,110 ),
(98,96,97 ,112,110,111 ), (99,96,98 ,113,110,112 ), (98,100,99 ,112,114,113 ),
(92,100,98 ,105,114,112 ), (90,100,92 ,102,114,105 ), (101,100,90 ,115,114,102 ),
(102,100,101 ,116,114,115 ), (99,100,102 ,113,114,116 ), (102,103,99 ,116,117,113 ),
(96,99,103 ,110,113,117 ), (103,104,96 ,117,118,110 ), (93,96,104 ,109,110,118 ),
(106,105,93 ,119,120,109 ), (93,104,106 ,109,118,119 ), (107,106,104 ,121,119,118 ),
(104,103,107 ,118,117,121 ), (108,107,103 ,122,121,117 ), (103,102,108 ,117,116,122 ),
(101,109,102 ,115,123,116 ), (109,108,102 ,123,122,116 ), (101,110,109 ,115,124,123 ),
(111,110,101 ,125,124,115 ), (101,53,111 ,115,61,125 ), (90,53,101 ,102,61,115 ),
(39,54,40 ,44,60,45 ), (112,54,39 ,126,60,44 ), (39,38,112 ,44,43,126 ),
(113,112,38 ,127,126,43 ), (38,37,113 ,43,42,127 ), (114,112,113 ,128,126,127 ),
(115,112,114 ,129,126,128 ), (114,116,115 ,128,130,129 ), (118,117,115 ,131,132,129 ),
(115,116,118 ,129,130,131 ), (120,119,117 ,133,134,132 ), (117,118,120 ,132,131,133 ),
(123,122,121 ,135,136,137 ), (124,122,123 ,138,136,135 ), (125,122,124 ,139,136,138 ),
(124,126,125 ,138,140,139 ), (127,121,119 ,141,137,134 ), (119,120,127 ,134,133,141 ),
(128,117,119 ,142,132,134 ), (115,117,128 ,129,132,142 ), (128,53,115 ,142,61,129 ),
(111,53,128 ,125,61,142 ), (128,110,111 ,142,124,125 ), (119,110,128 ,134,124,142 ),
(121,110,119 ,137,124,134 ), (129,110,121 ,143,124,137 ), (109,110,129 ,123,124,143 ),
(129,130,109 ,143,144,123 ), (115,53,54 ,129,61,60 ), (54,112,115 ,60,126,129 ),
(127,123,121 ,141,135,137 ), (132,131,105 ,145,146,120 ), (105,106,132 ,120,119,145 ),
(132,133,131 ,145,147,148 ), (133,134,131 ,147,149,148 ), (135,134,133 ,150,149,147 ),
(133,136,135 ,147,151,150 ), (137,136,133 ,152,151,147 ), (138,137,133 ,153,152,147 ),
(133,132,138 ,147,145,153 ), (139,138,132 ,154,153,145 ), (140,138,139 ,155,153,154 ),
(141,138,140 ,156,153,155 ), (140,130,141 ,155,144,156 ), (109,130,140 ,123,144,155 ),
(140,108,109 ,155,122,123 ), (139,108,140 ,154,122,155 ), (107,108,139 ,121,122,154 ),
(142,135,136 ,157,150,151 ), (136,143,142 ,151,158,157 ), (144,142,143 ,159,157,158 ),
(143,145,144 ,158,160,159 ), (147,146,145 ,161,162,160 ), (145,143,147 ,160,158,161 ),
(124,146,147 ,138,162,161 ), (147,126,124 ,161,140,138 ), (121,122,125 ,137,136,139 ),
(125,129,121 ,139,143,137 ), (141,130,129 ,156,144,143 ), (129,125,141 ,143,139,156 ),
(126,147,137 ,140,161,152 ), (141,125,126 ,156,139,140 ), (126,137,141 ,140,152,156 ),
(138,141,137 ,153,156,152 ), (147,143,136 ,161,158,151 ), (136,137,147 ,151,152,161 ),
(132,106,107 ,145,119,121 ), (107,139,132 ,121,154,145 ), (28,31,29 ,33,35,34 ),
(148,27,25 ,163,32,30 ), (25,149,148 ,30,164,163 ), (28,27,148 ,33,32,163 ),
(148,150,28 ,163,165,33 ), (151,150,148 ,166,165,163 ), (148,149,151 ,163,167,166 ),
(153,149,152 ,168,167,169 ), (151,149,153 ,166,167,168 ), (154,150,151 ,170,165,166 ),
(151,155,154 ,166,171,170 ), (156,154,155 ,172,170,171 ), (158,157,156 ,173,174,172 ),
(156,155,158 ,172,171,173 ), (151,158,155 ,166,173,171 ), (153,158,151 ,168,173,166 ),
(149,25,152 ,164,30,175 ), (25,23,152 ,30,28,175 ), (152,23,21 ,175,28,26 ),
(21,159,152 ,26,176,175 ), (153,152,159 ,168,169,176 ), (159,160,153 ,176,177,168 ),
(158,153,160 ,173,168,177 ), (160,161,158 ,177,178,173 ), (162,158,161 ,179,173,178 ),
(157,158,162 ,174,173,179 ), (157,162,163 ,174,179,180 ), (163,164,157 ,180,181,174 ),
(156,157,164 ,172,174,181 ), (164,165,156 ,181,182,172 ), (164,166,165 ,181,183,182 ),
(167,166,164 ,184,183,181 ), (164,163,167 ,181,180,184 ), (168,167,163 ,185,184,180 ),
(166,167,169 ,183,184,186 ), (170,169,167 ,187,186,184 ), (172,171,170 ,188,189,187 ),
(170,173,172 ,187,190,188 ), (174,171,172 ,191,189,188 ), (172,175,174 ,188,192,191 ),
(172,177,176 ,188,193,194 ), (176,175,172 ,194,192,188 ), (179,178,176 ,195,196,194 ),
(176,177,179 ,194,193,195 ), (181,180,178 ,197,198,196 ), (178,179,181 ,196,195,197 ),
(183,182,181 ,199,200,197 ), (181,179,183 ,197,195,199 ), (184,183,179 ,201,199,195 ),
(179,177,184 ,195,193,201 ), (173,184,177 ,190,201,193 ), (177,172,173 ,193,188,190 ),
(167,185,173 ,184,202,190 ), (173,170,167 ,190,187,184 ), (167,168,185 ,184,185,202 ),
(163,162,168 ,180,179,185 ), (186,168,162 ,203,185,179 ), (161,187,186 ,178,204,203 ),
(188,187,161 ,205,204,178 ), (161,160,188 ,178,177,205 ), (189,188,160 ,206,205,177 ),
(160,159,189 ,177,176,206 ), (159,19,189 ,176,23,206 ), (21,19,159 ,26,23,176 ),
(190,189,19 ,207,206,23 ), (191,189,190 ,208,206,207 ), (19,16,190 ,23,21,207 ),
(15,16,19 ,18,209,23 ), (192,190,16 ,210,207,21 ), (16,17,192 ,21,20,210 ),
(193,192,17 ,211,210,20 ), (17,18,193 ,20,22,211 ), (194,192,193 ,212,210,211 ),
(193,195,194 ,211,213,212 ), (190,192,194 ,207,210,212 ), (194,191,190 ,212,208,207 ),
(188,189,191 ,205,206,208 ), (191,196,188 ,208,214,205 ), (194,197,196 ,212,215,214 ),
(196,191,194 ,214,208,212 ), (198,197,194 ,216,215,212 ), (194,195,198 ,212,213,216 ),
(199,197,198 ,217,215,216 ), (198,200,199 ,216,218,217 ), (201,199,200 ,219,217,218 ),
(200,202,201 ,218,220,219 ), (203,201,202 ,221,219,220 ), (202,204,203 ,220,222,221 ),
(183,205,182 ,199,223,200 ), (205,206,182 ,223,224,200 ), (207,206,205 ,225,224,223 ),
(205,208,207 ,223,226,225 ), (173,185,184 ,190,202,201 ), (185,208,184 ,202,226,201 ),
(168,208,185 ,185,226,202 ), (209,208,168 ,227,226,185 ), (168,210,209 ,185,228,227 ),
(186,210,168 ,203,228,185 ), (211,210,186 ,229,228,203 ), (186,187,211 ,203,204,229 ),
(196,211,187 ,214,229,204 ), (187,188,196 ,204,205,214 ), (199,211,196 ,217,229,214 ),
(196,197,199 ,214,215,217 ), (210,211,199 ,228,229,217 ), (199,201,210 ,217,219,228 ),
(209,210,201 ,227,228,219 ), (201,203,209 ,219,221,227 ), (207,209,203 ,225,227,221 ),
(208,209,207 ,226,227,225 ), (204,206,207 ,222,224,225 ), (207,203,204 ,225,221,222 ),
(162,161,186 ,179,178,203 ), (183,184,205 ,199,201,223 ), (205,184,208 ,223,201,226 ),
(0,14,2 ,230,25,230 ), (26,29,32 ,31,34,231 ), (213,212,26 ,232,233,31 ),
(26,212,24 ,31,233,29 ), (212,214,22 ,233,234,27 ), (22,24,212 ,27,29,233 ),
(214,212,213 ,234,233,232 ), (213,215,214 ,232,235,234 ), (22,214,216 ,27,234,236 ),
(216,20,22 ,236,237,27 ), (214,215,217 ,234,235,238 ), (217,216,214 ,238,236,234 ),
(218,216,217 ,239,236,238 ), (216,218,14 ,236,239,25 ), (14,20,216 ,25,237,236 ),
(221,220,219 ,240,241,242 ), (219,220,222 ,242,241,243 ), (5,224,223 ,5,244,245 ),
(223,4,5 ,245,6,5 ), (224,226,225 ,244,246,247 ), (225,223,224 ,247,245,244 ),
(227,225,226 ,248,247,246 ), (227,226,228 ,248,246,249 ), (227,228,229 ,248,249,250 ),
(227,229,220 ,248,250,241 ), (227,220,230 ,248,241,251 ), (227,230,225 ,248,251,247 ),
(230,220,221 ,251,241,240 ), (230,221,231 ,251,252,253 ), (230,231,232 ,251,253,254 ),
(233,225,230 ,255,247,251 ), (230,232,233 ,251,254,255 ), (233,234,223 ,256,257,245 ),
(223,225,233 ,245,247,256 ), (234,18,4 ,257,22,6 ), (4,223,234 ,6,245,257 ),
(232,231,235 ,254,253,258 ), (235,231,236 ,258,259,260 ), (236,237,235 ,260,261,258 ),
(236,239,238 ,260,262,263 ), (238,237,236 ,263,261,260 ), (239,241,240 ,262,264,265 ),
(240,238,239 ,265,263,262 ), (241,243,242 ,264,266,267 ), (242,240,241 ,267,265,264 ),
(242,243,244 ,267,266,268 ), (243,245,244 ,266,269,268 ), (245,247,246 ,269,270,271 ),
(247,245,248 ,270,269,272 ), (222,220,249 ,243,241,273 ), (249,220,229 ,273,241,250 ),
(222,249,250 ,243,273,274 ), (250,251,222 ,274,275,243 ), (251,250,252 ,275,274,276 ),
(252,248,251 ,276,272,275 ), (248,252,247 ,272,276,270 ), (247,253,246 ,270,277,271 ),
(247,254,253 ,270,278,277 ), (247,252,254 ,270,276,278 ), (254,252,255 ,278,276,279 ),
(255,252,250 ,279,276,274 ), (250,249,256 ,274,273,280 ), (249,257,256 ,273,281,280 ),
(256,255,250 ,280,279,274 ), (249,229,257 ,273,250,281 ), (257,229,258 ,281,250,282 ),
(260,259,228 ,283,284,249 ), (228,226,260 ,249,246,283 ), (259,258,229 ,284,282,250 ),
(229,228,259 ,250,249,284 ), (259,261,258 ,284,285,282 ), (258,261,262 ,282,285,286 ),
(262,261,263 ,286,285,287 ), (262,257,258 ,286,281,282 ), (257,262,264 ,281,286,288 ),
(264,265,257 ,288,289,290 ), (257,265,266 ,281,291,292 ), (266,267,257 ,292,293,281 ),
(257,267,268 ,281,293,294 ), (268,270,269 ,294,295,296 ), (269,256,268 ,296,280,294 ),
(268,256,257 ,294,280,281 ), (265,271,266 ,291,297,292 ), (266,271,267 ,292,297,293 ),
(271,265,272 ,297,291,298 ), (272,265,273 ,298,289,299 ), (260,226,224 ,283,246,244 ),
(224,274,260 ,244,300,283 ), (59,274,224 ,66,300,244 ), (224,5,59 ,244,5,66 ),
(60,275,274 ,68,301,300 ), (274,59,60 ,300,66,68 ), (275,276,260 ,301,302,283 ),
(260,274,275 ,283,300,301 ), (260,276,259 ,283,302,284 ), (259,276,261 ,284,302,285 ),
(261,276,277 ,285,302,303 ), (278,263,261 ,304,287,285 ), (261,277,278 ,285,303,304 ),
(276,275,279 ,302,301,305 ), (279,277,276 ,305,303,302 ), (265,264,280 ,289,288,306 ),
(280,273,265 ,306,299,289 ), (280,264,281 ,306,288,307 ), (281,264,262 ,307,288,286 ),
(282,281,263 ,308,307,309 ), (263,281,262 ,309,307,286 ), (278,283,282 ,310,311,308 ),
(282,263,278 ,308,309,310 ), (283,278,284 ,311,310,312 ), (284,285,283 ,312,313,311 ),
(287,286,285 ,314,315,313 ), (285,284,287 ,313,312,314 ), (286,287,288 ,315,314,316 ),
(288,272,289 ,316,298,317 ), (272,273,289 ,298,299,317 ), (289,286,288 ,317,315,316 ),
(60,76,279 ,68,86,305 ), (279,275,60 ,305,301,68 ), (290,278,277 ,318,304,303 ),
(277,279,290 ,303,305,318 ), (279,76,290 ,305,86,318 ), (76,78,284 ,89,88,312 ),
(284,290,76 ,312,318,89 ), (284,278,290 ,312,310,318 ), (284,78,79 ,312,88,90 ),
(79,287,284 ,90,314,312 ), (287,79,288 ,314,90,316 ), (79,80,291 ,90,91,319 ),
(291,288,79 ,319,316,90 ), (292,272,288 ,320,298,316 ), (288,291,292 ,316,319,320 ),
(272,292,271 ,298,320,297 ), (83,293,291 ,95,321,322 ), (291,80,83 ,322,96,95 ),
(293,294,292 ,321,323,320 ), (292,291,293 ,320,322,321 ), (292,294,271 ,320,323,297 ),
(271,294,295 ,297,323,324 ), (295,296,271 ,324,325,297 ), (271,296,267 ,297,325,293 ),
(267,296,297 ,293,325,326 ), (297,268,267 ,326,294,293 ), (297,298,268 ,326,327,294 ),
(268,298,270 ,294,327,295 ), (270,298,299 ,295,327,328 ), (300,299,298 ,329,329,327 ),
(300,298,297 ,330,327,330 ), (300,301,299 ,331,332,328 ), (93,302,95 ,109,333,107 ),
(302,93,303 ,333,109,334 ), (303,304,302 ,334,335,333 ), (304,303,305 ,335,334,336 ),
(305,303,306 ,336,334,337 ), (306,307,305 ,337,338,336 ), (305,307,301 ,336,338,332 ),
(301,307,299 ,332,338,328 ), (299,307,308 ,328,338,339 ), (308,307,309 ,339,338,340 ),
(307,306,310 ,338,337,341 ), (310,309,307 ,341,340,338 ), (306,303,311 ,337,334,342 ),
(311,310,306 ,342,341,337 ), (311,303,93 ,342,334,109 ), (105,312,311 ,120,343,342 ),
(311,93,105 ,342,109,120 ), (312,313,310 ,343,344,341 ), (310,311,312 ,341,342,343 ),
(313,314,309 ,344,345,340 ), (309,310,313 ,340,341,344 ), (309,315,308 ,340,346,339 ),
(309,314,315 ,340,345,346 ), (315,316,308 ,346,347,339 ), (308,316,317 ,339,347,348 ),
(317,270,308 ,348,295,339 ), (308,270,299 ,339,295,328 ), (256,269,255 ,280,296,279 ),
(255,269,318 ,279,296,349 ), (318,254,255 ,349,278,279 ), (254,318,319 ,278,349,350 ),
(319,253,254 ,350,277,278 ), (319,318,320 ,350,349,351 ), (320,318,321 ,351,349,352 ),
(321,322,320 ,352,353,351 ), (324,323,322 ,354,355,353 ), (322,321,324 ,353,352,354 ),
(326,325,323 ,356,357,355 ), (323,324,326 ,355,354,356 ), (329,328,327 ,358,359,360 ),
(327,328,330 ,360,359,361 ), (330,328,331 ,361,359,362 ), (331,332,330 ,362,363,361 ),
(326,329,333 ,356,358,364 ), (333,325,326 ,364,357,356 ), (326,324,334 ,356,354,365 ),
(334,324,321 ,365,354,352 ), (321,270,334 ,352,295,365 ), (334,270,317 ,365,295,348 ),
(317,316,334 ,348,347,365 ), (334,316,326 ,365,347,356 ), (326,316,329 ,356,347,358 ),
(329,316,335 ,358,347,366 ), (316,315,336 ,347,346,367 ), (336,335,316 ,367,366,347 ),
(269,270,321 ,296,295,352 ), (321,318,269 ,352,349,296 ), (329,327,333 ,358,360,364 ),
(131,337,312 ,146,368,343 ), (312,105,131 ,343,120,146 ), (131,338,337 ,148,369,368 ),
(131,134,338 ,148,149,369 ), (134,135,339 ,149,150,370 ), (339,338,134 ,370,369,149 ),
(338,339,340 ,369,370,371 ), (338,340,341 ,369,371,372 ), (341,337,338 ,372,368,369 ),
(337,341,342 ,368,372,373 ), (342,341,343 ,373,372,374 ), (343,341,344 ,374,372,375 ),
(344,336,343 ,375,367,374 ), (343,336,315 ,374,367,346 ), (315,314,343 ,346,345,374 ),
(343,314,342 ,374,345,373 ), (342,314,313 ,373,345,344 ), (135,142,345 ,150,157,376 ),
(345,339,135 ,376,370,150 ), (142,144,346 ,157,159,377 ), (346,345,142 ,377,376,157 ),
(348,347,345 ,378,379,376 ), (345,346,348 ,376,377,378 ), (348,330,332 ,378,361,363 ),
(332,347,348 ,363,379,378 ), (328,329,335 ,359,358,366 ), (335,331,328 ,366,362,359 ),
(336,344,331 ,367,375,362 ), (331,335,336 ,362,366,367 ), (340,347,332 ,371,379,363 ),
(331,344,340 ,362,375,371 ), (340,332,331 ,371,363,362 ), (340,344,341 ,371,375,372 ),
(345,347,340 ,376,379,371 ), (340,339,345 ,371,370,376 ), (312,337,342 ,343,368,373 ),
(342,313,312 ,373,344,343 ), (245,246,244 ,269,271,268 ), (242,350,349 ,267,380,381 ),
(349,240,242 ,381,265,267 ), (350,242,244 ,380,267,268 ), (244,351,350 ,268,382,380 ),
(350,351,352 ,380,382,383 ), (352,349,350 ,383,381,380 ), (354,349,353 ,384,381,385 ),
(353,349,352 ,385,381,383 ), (351,356,355 ,382,386,387 ), (355,352,351 ,387,383,382 ),
(355,356,357 ,387,386,388 ), (359,358,355 ,389,390,387 ), (355,357,359 ,387,388,389 ),
(355,358,352 ,387,390,383 ), (352,358,353 ,383,390,385 ), (354,240,349 ,384,265,381 ),
(354,238,240 ,384,263,265 ), (238,354,360 ,263,384,391 ), (360,237,238 ,391,261,263 ),
(354,353,361 ,384,385,392 ), (361,360,354 ,392,391,384 ), (353,358,362 ,385,390,393 ),
(362,361,353 ,393,392,385 ), (362,358,363 ,393,390,394 ), (363,358,359 ,394,390,389 ),
(363,359,364 ,394,389,395 ), (364,365,363 ,395,396,394 ), (359,357,366 ,389,388,397 ),
(366,364,359 ,397,395,389 ), (366,367,364 ,397,398,395 ), (367,368,365 ,398,399,396 ),
(365,364,367 ,396,395,398 ), (365,368,369 ,396,399,400 ), (370,368,367 ,401,399,398 ),
(368,370,371 ,399,401,402 ), (374,373,372 ,403,404,405 ), (372,371,374 ,405,402,403 ),
(374,376,375 ,403,406,407 ), (375,373,374 ,407,404,403 ), (377,373,375 ,408,404,407 ),
(375,378,377 ,407,409,408 ), (380,379,377 ,410,411,408 ), (377,378,380 ,408,409,410 ),
(180,181,379 ,198,197,411 ), (379,380,180 ,411,410,198 ), (182,381,379 ,200,412,411 ),
(379,181,182 ,411,197,200 ), (381,382,377 ,412,413,408 ), (377,379,381 ,408,411,412 ),
(382,372,373 ,413,405,404 ), (373,377,382 ,404,408,413 ), (383,368,371 ,414,399,402 ),
(371,372,383 ,402,405,414 ), (383,369,368 ,414,400,399 ), (369,363,365 ,400,394,396 ),
(363,369,384 ,394,400,415 ), (384,385,362 ,415,416,393 ), (385,386,361 ,416,417,392 ),
(361,362,385 ,392,393,416 ), (386,387,360 ,417,418,391 ), (360,361,386 ,391,392,417 ),
(387,235,360 ,418,258,391 ), (360,235,237 ,391,258,261 ), (235,387,388 ,258,418,419 ),
(388,387,389 ,419,418,420 ), (388,233,235 ,419,256,258 ), (235,233,232 ,258,255,254 ),
(233,388,390 ,256,419,421 ), (390,234,233 ,421,257,256 ), (234,390,193 ,257,421,211 ),
(193,18,234 ,211,22,257 ), (390,391,195 ,421,422,213 ), (195,193,390 ,213,211,421 ),
(390,388,389 ,421,419,420 ), (389,391,390 ,420,422,421 ), (387,386,392 ,418,417,423 ),
(392,389,387 ,423,420,418 ), (393,391,389 ,424,422,420 ), (389,392,393 ,420,423,424 ),
(393,198,195 ,424,216,213 ), (195,391,393 ,213,422,424 ), (393,394,200 ,424,425,218 ),
(200,198,393 ,218,216,424 ), (394,395,202 ,425,426,220 ), (202,200,394 ,220,218,425 ),
(395,396,204 ,426,427,222 ), (204,202,395 ,222,220,426 ), (182,397,381 ,200,428,412 ),
(182,206,397 ,200,224,428 ), (397,206,398 ,428,224,429 ), (398,399,397 ,429,430,428 ),
(382,383,372 ,413,414,405 ), (382,399,383 ,413,430,414 ), (383,399,369 ,414,430,400 ),
(369,399,400 ,400,430,431 ), (400,401,369 ,431,432,400 ), (369,401,384 ,400,432,415 ),
(401,402,385 ,432,433,416 ), (385,384,401 ,416,415,432 ), (402,392,386 ,433,423,417 ),
(386,385,402 ,417,416,433 ), (402,394,393 ,433,425,424 ), (393,392,402 ,424,423,433 ),
(394,402,401 ,425,433,432 ), (401,395,394 ,432,426,425 ), (401,400,396 ,432,431,427 ),
(396,395,401 ,427,426,432 ), (396,400,398 ,427,431,429 ), (398,400,399 ,429,431,430 ),
(206,204,396 ,224,222,427 ), (396,398,206 ,427,429,224 ), (384,362,363 ,415,393,394 ),
(397,382,381 ,428,413,412 ), (399,382,397 ,430,413,428 ), (219,231,221 ,434,259,434 ),
(248,245,243 ,435,269,266 ), (243,404,403 ,266,436,437 ), (241,404,243 ,264,436,266 ),
(405,404,241 ,438,436,264 ), (241,239,405 ,264,262,438 ), (404,405,406 ,436,438,439 ),
(406,403,404 ,439,437,436 ), (405,239,236 ,438,262,260 ), (236,407,405 ,260,440,438 ),
(406,405,407 ,439,438,440 ), (407,408,406 ,440,441,439 ), (408,407,409 ,441,440,442 ),
(231,409,407 ,259,442,440 ), (407,236,231 ,440,260,259 )
, (412,411,410 ,443,443,443 ), (413,411,412 ,444,445,446 ), (412,414,413 ,446,447,444 ),
(415,413,414 ,448,444,447 ), (414,416,415 ,447,449,448 ), (415,416,218 ,448,449,450 ),
(417,218,416 ,451,450,449 ), (218,417,14 ,450,451,452 ), (419,219,418 ,453,454,455 ),
(420,418,219 ,456,455,454 ), (418,420,421 ,455,456,457 ), (422,421,420 ,458,457,456 ),
(420,423,422 ,456,459,458 ), (424,422,423 ,460,458,459 ), (423,425,424 ,459,461,460 ),
(426,424,425 ,462,460,462 ), (427,428,429 ,463,463,464 ), (67,428,427 ,465,463,463 ),
(430,428,67 ,466,467,465 ), (430,431,428 ,466,468,467 ), (431,432,428 ,468,469,467 ),
(432,73,428 ,469,470,467 ), (73,433,428 ,471,472,472 ), (433,429,428 ,472,473,472 ),
(434,286,285 ,474,475,476 ), (434,285,283 ,474,476,477 ), (435,434,282 ,478,479,480 ),
(434,283,282 ,474,477,480 ), (436,434,435 ,481,479,478 ), (437,434,436 ,482,479,481 ),
(434,437,438 ,483,484,483 ), (434,438,286 ,483,483,485 ), (87,440,439 ,486,487,488 ),
(441,87,439 ,489,486,488 ), (442,87,441 ,490,486,489 ), (441,443,442 ,489,491,490 ),
(444,442,443 ,492,490,491 ), (443,445,444 ,491,493,492 ), (446,444,445 ,494,492,493 ),
(445,447,446 ,493,495,494 ), (448,446,447 ,496,494,495 ), (447,449,448 ,495,497,496 ),
(450,448,449 ,498,496,497 ), (449,451,450 ,497,499,498 ), (294,450,451 ,500,498,499 ),
(451,452,294 ,499,501,500 ), (453,294,452 ,502,500,501 ), (452,454,453 ,501,503,502 ),
(455,453,454 ,504,502,503 ), (454,456,455 ,503,505,504 ), (457,455,456 ,506,504,505 ),
(457,458,455 ,506,507,504 ), (459,441,439 ,508,509,510 ), (92,459,439 ,511,508,510 ),
(459,460,443 ,508,512,513 ), (443,441,459 ,513,509,508 ), (461,460,459 ,514,512,508 ),
(459,92,461 ,508,511,514 ), (460,462,445 ,512,515,516 ), (445,443,460 ,516,513,512 ),
(462,460,461 ,515,512,514 ), (461,463,462 ,514,517,515 ), (462,464,447 ,515,518,519 ),
(447,445,462 ,519,516,515 ), (464,462,463 ,518,515,517 ), (463,94,464 ,517,520,518 ),
(464,465,449 ,518,521,522 ), (449,447,464 ,522,519,518 ), (465,464,94 ,521,518,520 ),
(94,95,465 ,520,523,521 ), (465,466,451 ,521,524,525 ), (451,449,465 ,525,522,521 ),
(466,465,95 ,524,521,523 ), (95,302,466 ,523,526,524 ), (466,467,452 ,524,527,528 ),
(452,451,466 ,528,525,524 ), (467,466,302 ,527,524,526 ), (302,468,467 ,526,529,527 ),
(467,469,454 ,527,530,531 ), (454,452,467 ,531,528,527 ), (470,469,467 ,532,530,527 ),
(467,468,470 ,527,529,532 ), (469,471,456 ,530,533,534 ), (456,454,469 ,534,531,530 ),
(469,470,472 ,530,532,535 ), (472,471,469 ,535,533,530 ), (457,456,471 ,536,534,533 ),
(457,471,472 ,536,533,535 )
);

const Vertices : Array[0..472, 0..2] of Single = (
(-0.0732834, 0.0566459, 0.0922583),(-0.0781286, 0.0255884, 0.0695454),(-0.0853963, 0.059006, 0.0754652),
(-0.11689, 0.0526324, 0.059891),(0.00181693, -0.0453446, 0.139084),(0.00181693, -0.0728231, 0.108312),
(-0.0211977, -0.0750535, 0.106776),(-0.0272541, -0.0402094, 0.13736),(-0.043001, -0.0629288, 0.0901316),
(-0.0454236, -0.0337256, 0.126039),(-0.0599591, -0.0254458, 0.0758283),(-0.0587478, -0.0402159, 0.059074),
(-0.0781286, -0.0156098, 0.0319522),(-0.0648043, 0.0253291, 0.106205),(-0.0878189, 0.0508753, 0.115911),
(-0.0805511, 0.0286488, 0.134805),(-0.0563253, -0.0187674, 0.150159),(-0.0320993, -0.025945, 0.157712),
(0.00181693, -0.0317545, 0.164235),(-0.113256, -0.0053265, 0.185074),(-0.14475, 0.0439052, 0.139396),
(-0.166553, 0.0191499, 0.176282),(-0.206526, 0.0594793, 0.133022),(-0.218639, 0.0540459, 0.154276),
(-0.248921, 0.100898, 0.116826),(-0.262245, 0.102642, 0.130526),(-0.265879, 0.130322, 0.0989431),
(-0.27557, 0.137201, 0.110919),(-0.293739, 0.183567, 0.0856318),(-0.259823, 0.135736, 0.069124),
(-0.267091, 0.121432, 0.031641),(-0.296162, 0.175767, 0.0453933),(-0.212582, 0.085674, 0.0510795),
(-0.119313, 0.0158562, 0.00824089),(-0.179877, 0.0403521, 0.00801397),(-0.176243, 0.0623776, 0.051475),
(-0.21985, 0.0660669, 0.0165208),(-0.31312, 0.178963, -0.0556831),(-0.287683, 0.11301, -0.0563898),
(-0.231963, 0.0420898, -0.0565714),(-0.183511, 0.0121021, -0.0607859),(-0.0902415, -0.0230208, -0.0632757),
(-0.0660156, -0.0578389, -0.00700907),(-0.0393671, -0.102947, 0.0441418),(-0.0514801, -0.0779842, 0.0231861),
(-0.0514801, -0.104244, 0.00114758),(-0.075706, -0.100217, -0.0362058),(-0.0623817, -0.134121, -0.0299618),
(-0.0805511, -0.0877747, -0.0638139),(-0.0575365, -0.0756889, -0.0975881),(-0.0744946, -0.0613337, -0.112695),
(-0.103566, -0.0564254, -0.138916),(-0.160497, -0.0011184, -0.149491),(-0.204103, 0.0369222, -0.219983),
(-0.222273, 0.0407347, -0.125261),(-0.0623817, -0.0886241, -0.136102),(-0.030888, -0.10757, -0.105738),
(-0.0478462, -0.0981034, -0.0860599),(-0.0187751, -0.1221, 0.0585748),(0.00181693, -0.125005, 0.0618361),
(0.00181693, -0.183709, 0.00955056),(-0.0175638, -0.160037, 0.0238863),(-0.0381558, -0.124745, 0.0251766),
(-0.0405784, -0.153573, 0.00400043),(-0.0417897, -0.169562, -0.0214875),(-0.0187751, -0.185454, -0.00414975),
(-0.0648043, -0.10543, -0.0687416),(-0.0660156, -0.116543, -0.0592946),(-0.0526913, -0.134348, -0.0544577),
(-0.0466349, -0.143438, -0.0594049),(-0.0369445, -0.14089, -0.0688324),(-0.0236203, -0.180059, -0.042534),
(-0.0187751, -0.126386, -0.0937043),(-0.0272541, -0.125335, -0.0837711),(-0.0175638, -0.113062, -0.11018),
(-0.0345219, -0.111655, -0.0940804),(0.00181693, -0.199361, -0.0183364),(-0.0199864, -0.191659, -0.0209234),
(0.00181693, -0.18334, -0.0540038),(0.000605662, -0.11786, -0.110854),(0.000605662, -0.104386, -0.137094),
(-0.0151412, -0.103187, -0.136925),(-0.0320993, -0.102324, -0.134358),(0.000605662, -0.118164, -0.16961),
(-0.0175638, -0.117996, -0.17081),(-0.0442123, -0.112167, -0.168768),(-0.0720721, -0.0957303, -0.172574),
(-0.110834, -0.0674868, -0.182059),(-0.150806, -0.0207644, -0.20118),(-0.164131, -0.00950196, -0.220392),
(-0.139905, -0.0253225, -0.247079),(-0.135059, -0.0168676, -0.220204),(-0.108411, -0.0631621, -0.238942),
(-0.000605662, -0.0853756, -0.289769),(-0.0211977, -0.116278, -0.24396),(0.000605662, -0.116278, -0.24396),
(-0.0393671, -0.0841567, -0.281035),(-0.0417897, -0.11251, -0.244654),(-0.0805511, -0.0909193, -0.24162),
(-0.0769173, -0.0764345, -0.275057),(-0.105988, -0.0616838, -0.266868),(-0.137482, -0.0225344, -0.301731),
(-0.0926641, -0.0540588, -0.303715),(-0.0720721, -0.0662224, -0.304202),(-0.0381558, -0.0778609, -0.299721),
(-0.000605662, -0.0938889, -0.342339),(-0.0454236, -0.0873856, -0.345095),(-0.0744946, -0.0731601, -0.341873),
(-0.0938754, -0.0606593, -0.343785),(-0.135059, -0.0200641, -0.345419),(-0.1823, 0.0359562, -0.343662),
(-0.187145, 0.0365786, -0.29587),(-0.28526, 0.113211, -0.118745),(-0.315542, 0.18415, -0.109998),
(-0.311909, 0.185363, -0.17955),(-0.271936, 0.118171, -0.197556),(-0.290105, 0.181946, -0.250976),
(-0.24771, 0.126373, -0.282027),(-0.279204, 0.179994, -0.280607),(-0.234386, 0.130192, -0.335311),
(-0.259823, 0.174723, -0.338838),(-0.222273, 0.13523, -0.379861),(-0.193202, 0.141993, -0.419277),
(-0.207737, 0.170087, -0.418998),(-0.148384, 0.165023, -0.461298),(-0.158074, 0.0489562, -0.427459),
(-0.114467, 0.0516341, -0.455216),(-0.23802, 0.168965, -0.384906),(-0.222273, 0.0869579, -0.28879),
(-0.176243, 0.0380893, -0.384951),(-0.137482, -0.0237598, -0.388751),(-0.000605662, -0.0979607, -0.400402),
(-0.0405784, -0.0928255, -0.402127),(-0.0405784, -0.0668708, -0.438845),(-0.000605662, -0.0706379, -0.438151),
(-0.00181693, -0.0114341, -0.46775),(-0.0417897, -0.0143388, -0.464488),(-0.0805511, -0.0170555, -0.453861),
(-0.0732834, -0.0639271, -0.424976),(-0.0744946, -0.0786, -0.398904),(-0.0950867, -0.0643745, -0.395682),
(-0.115679, -0.0205957, -0.428672),(-0.00181693, 0.0502076, -0.479881),(-0.0442123, 0.0519323, -0.474746),
(-0.00181693, 0.159454, -0.5),(-0.0502688, 0.147309, -0.491921),(-0.0938754, 0.159661, -0.484069),
(-0.0817625, 0.0521204, -0.46738),(-0.282838, 0.146648, 0.122032),(-0.274358, 0.104743, 0.150392),
(-0.292528, 0.177913, 0.160676),(-0.270725, 0.132747, 0.186131),(-0.227118, 0.0503371, 0.180665),
(-0.221061, 0.0673766, 0.216086),(-0.281626, 0.175293, 0.214128),(-0.268302, 0.151848, 0.224288),
(-0.270725, 0.171792, 0.256448),(-0.216216, 0.104866, 0.280069),(-0.215005, 0.0886889, 0.247215),
(-0.171398, 0.0168093, 0.20164),(-0.170187, 0.0268203, 0.234851),(-0.166553, 0.0417785, 0.25897),
(-0.165342, 0.060186, 0.293361),(-0.167764, 0.0773941, 0.327582),(-0.216216, 0.118307, 0.314984),
(-0.250133, 0.162818, 0.302892),(-0.208949, 0.150454, 0.36476),(-0.162919, 0.103038, 0.380114),
(-0.121735, 0.047951, 0.336899),(-0.179877, 0.144366, 0.399378),(-0.148384, 0.143581, 0.431071),
(-0.12658, 0.159233, 0.458957),(-0.103566, 0.156853, 0.467185),(-0.112045, 0.117736, 0.440893),
(-0.11689, 0.197993, 0.479083),(-0.0890302, 0.195782, 0.486112),(-0.0575365, 0.191866, 0.49657),
(-0.0623817, 0.146265, 0.481599),(-0.0248315, 0.188961, 0.499831),(-0.0320993, 0.140624, 0.486922),
(0.00302825, 0.190161, 0.5),(0.00423952, 0.137888, 0.488984),(0.00423952, 0.0926051, 0.463049),
(-0.0381558, 0.0965408, 0.461155),(-0.0720721, 0.102013, 0.457032),(-0.120524, 0.0735945, 0.389431),
(-0.11689, 0.0324482, 0.299248),(-0.120524, 0.0135349, 0.268456),(-0.118101, 0.00286904, 0.248609),
(-0.122947, -0.00337487, 0.214705),(-0.0720721, -0.0195325, 0.190417),(-0.0720721, -0.0194547, 0.224677),
(-0.0381558, -0.0236368, 0.19351),(0.00181693, -0.0256792, 0.199339),(-0.0417897, -0.0223595, 0.227939),
(0.00302825, -0.0247585, 0.227602),(-0.0732834, -0.0101375, 0.25412),(-0.043001, -0.0123679, 0.252584),
(0.00302825, -0.0125365, 0.253783),(-0.0417897, 0.000359796, 0.275167),(0.00302825, -0.00100829, 0.276198),
(-0.0442123, 0.0122446, 0.303748),(0.00302825, 0.010708, 0.305978),(-0.0454236, 0.0238118, 0.343292),
(0.00302825, 0.0222751, 0.345523),(-0.0417897, 0.0664948, 0.431246),(0.00302825, 0.0445081, 0.404915),
(-0.0417897, 0.0439829, 0.399948),(-0.0769173, 0.0530538, 0.39633),(-0.0744946, 0.0292841, 0.339169),
(-0.0732834, 0.0184108, 0.303391),(-0.0732834, 0.00172788, 0.274136),(-0.241653, 0.0934935, 0.0998833),
(-0.230752, 0.0850386, 0.0730078),(-0.199258, 0.0563282, 0.103222),(-0.184723, 0.0547137, 0.0711923),
(-0.138693, 0.0433217, 0.108734),(-0.133848, 0.0446314, 0.0820074),(-0.109622, 0.0475556, 0.0873111),
(0.0890302, 0.0591746, 0.0742657),(0.0817625, 0.025757, 0.0683459),(0.0769173, 0.0568145, 0.0910588),
(0.119313, 0.0540005, 0.0588601),(0.0320993, -0.0402094, 0.13736),(0.0260429, -0.0750535, 0.106776),
(0.0502688, -0.033557, 0.124839),(0.0478462, -0.0627602, 0.0889321),(0.063593, -0.0252772, 0.0746287),
(0.0623817, -0.0400473, 0.0578745),(0.0817625, -0.0154412, 0.0307527),(0.0684382, 0.0254976, 0.105005),
(0.0914528, 0.0510439, 0.114712),(0.0841851, 0.0288174, 0.133606),(0.0611704, -0.0185989, 0.148959),
(0.0369445, -0.025945, 0.157712),(0.118101, -0.00395839, 0.184043),(0.148384, 0.0454419, 0.137165),
(0.171398, 0.0206866, 0.174052),(0.222273, 0.0557512, 0.150846),(0.21016, 0.061016, 0.130792),
(0.265879, 0.104347, 0.127096),(0.252555, 0.102603, 0.113396),(0.277992, 0.138906, 0.107489),
(0.268302, 0.132027, 0.0955132),(0.296162, 0.185272, 0.0822019),(0.262245, 0.137441, 0.0656941),
(0.297373, 0.177472, 0.0419633),(0.269513, 0.123138, 0.0282111),(0.215005, 0.0873793, 0.0476496),
(0.121735, 0.0172243, 0.00720996),(0.1823, 0.0418888, 0.00578353),(0.178666, 0.0639143, 0.0492446),
(0.222273, 0.0677722, 0.0130908),(0.31312, 0.180837, -0.0603125),(0.288894, 0.114715, -0.0598198),
(0.233174, 0.043795, -0.0600013),(0.184723, 0.0136388, -0.0630163),(0.0926641, -0.0228522, -0.0644752),
(0.0684382, -0.0576703, -0.00820859),(0.0551139, -0.0778156, 0.0219866),(0.043001, -0.102947, 0.0441418),
(0.0551139, -0.104075, -5.19579e-05),(0.0781286, -0.100049, -0.0374053),(0.0660156, -0.133952, -0.0311613),
(0.0829737, -0.0876061, -0.0650134),(0.0599591, -0.0755203, -0.0987876),(0.075706, -0.0611651, -0.113895),
(0.104777, -0.0562568, -0.140115),(0.160497, 0.000418296, -0.151722),(0.222273, 0.0424399, -0.128691),
(0.202892, 0.0384589, -0.222214),(0.063593, -0.0884555, -0.137302),(0.0333106, -0.10757, -0.105738),
(0.0502688, -0.0979348, -0.0872594),(0.0236203, -0.1221, 0.0585748),(0.0211976, -0.160037, 0.0238863),
(0.0417897, -0.124745, 0.0251766),(0.0442123, -0.153404, 0.00280092),(0.0454236, -0.169393, -0.022687),
(0.022409, -0.185454, -0.00414975),(0.0672269, -0.105262, -0.0699411),(0.0684382, -0.116375, -0.0604942),
(0.0551139, -0.134179, -0.0556572),(0.0490574, -0.14327, -0.0606044),(0.0272541, -0.180059, -0.042534),
(0.0393671, -0.14089, -0.0688324),(0.0296767, -0.125335, -0.0837711),(0.0211977, -0.126386, -0.0937043),
(0.0199864, -0.113062, -0.11018),(0.0369445, -0.111655, -0.0940804),(0.0236202, -0.191659, -0.0209234),
(0.0163525, -0.103187, -0.136925),(0.0333106, -0.102324, -0.134358),(0.018775, -0.117996, -0.17081),
(0.0454236, -0.111998, -0.169967),(0.0732834, -0.0955617, -0.173773),(0.112045, -0.0661187, -0.18309),
(0.150806, -0.0192277, -0.203411),(0.164131, -0.00796527, -0.222622),(0.139905, -0.0237858, -0.24931),
(0.135059, -0.0153309, -0.222434),(0.108411, -0.061794, -0.239973),(0.0211977, -0.116278, -0.24396),
(0.0393671, -0.0841567, -0.281035),(0.0417897, -0.11251, -0.244654),(0.0805511, -0.0907507, -0.242819),
(0.0769173, -0.0762659, -0.276256),(0.105988, -0.0615152, -0.268067),(0.136271, -0.0209977, -0.303962),
(0.0914528, -0.0538902, -0.304915),(0.0708608, -0.0660538, -0.305401),(0.0369445, -0.0778609, -0.299721),
(0.0442123, -0.087217, -0.346295),(0.0732834, -0.0729915, -0.343072),(0.0926641, -0.0604907, -0.344985),
(0.132637, -0.0185274, -0.34765),(0.179877, 0.0374928, -0.345893),(0.185934, 0.0381153, -0.2981),
(0.28526, 0.114916, -0.122175),(0.315542, 0.186024, -0.114627),(0.310697, 0.187237, -0.184179),
(0.270725, 0.119876, -0.200986),(0.287683, 0.183651, -0.254406),(0.276781, 0.1817, -0.284037),
(0.245287, 0.128078, -0.285457),(0.256189, 0.176428, -0.342268),(0.231963, 0.131897, -0.338741),
(0.202892, 0.171624, -0.421228),(0.189568, 0.143529, -0.421507),(0.218639, 0.136935, -0.383291),
(0.143539, 0.16656, -0.463528),(0.15444, 0.0504929, -0.42969),(0.110834, 0.0530022, -0.456247),
(0.234386, 0.170671, -0.388336),(0.21985, 0.0886632, -0.292219),(0.173821, 0.039626, -0.387182),
(0.135059, -0.0222231, -0.390981),(0.0381558, -0.0928255, -0.402127),(0.0381558, -0.0668708, -0.438845),
(0.0381558, -0.0143388, -0.464488),(0.0769173, -0.016887, -0.455061),(0.0708608, -0.0637585, -0.426175),
(0.0720721, -0.0784314, -0.400104),(0.0926641, -0.0642059, -0.396881),(0.113256, -0.0192276, -0.429702),
(0.0405784, 0.0519324, -0.474746),(0.0454236, 0.147478, -0.493121),(0.0781286, 0.052289, -0.468579),
(0.0890302, 0.15983, -0.485269),(0.277992, 0.106448, 0.146962),(0.286471, 0.148353, 0.118602),
(0.296162, 0.179618, 0.157246),(0.274358, 0.134452, 0.182701),(0.225907, 0.0690819, 0.212656),
(0.231963, 0.0520424, 0.177235),(0.273147, 0.153553, 0.220858),(0.28526, 0.176999, 0.210698),
(0.27557, 0.173497, 0.253018),(0.21985, 0.0903942, 0.243785),(0.222273, 0.106571, 0.276639),
(0.176243, 0.018346, 0.19941),(0.176243, 0.028357, 0.23262),(0.17261, 0.0433151, 0.25674),
(0.171398, 0.0617227, 0.29113),(0.222273, 0.120012, 0.311554),(0.173821, 0.0789308, 0.325352),
(0.254978, 0.164524, 0.299462),(0.215005, 0.15199, 0.36253),(0.170187, 0.104574, 0.377884),
(0.129003, 0.0493191, 0.335868),(0.187145, 0.145902, 0.397147),(0.155651, 0.145118, 0.42884),
(0.119313, 0.119105, 0.439863),(0.110834, 0.158221, 0.466154),(0.133848, 0.16077, 0.456727),
(0.096298, 0.195951, 0.484912),(0.124158, 0.199361, 0.478052),(0.0708608, 0.146434, 0.480399),
(0.0648043, 0.192034, 0.495371),(0.0405784, 0.140624, 0.486922),(0.0320993, 0.188961, 0.499831),
(0.0466349, 0.0965408, 0.461155),(0.0805511, 0.102182, 0.455832),(0.127792, 0.0749626, 0.3884),
(0.122946, 0.0338163, 0.298217),(0.12658, 0.014903, 0.267425),(0.124158, 0.00423714, 0.247578),
(0.127792, -0.00200677, 0.213674),(0.0769173, -0.019364, 0.189217),(0.0781286, -0.0192862, 0.223478),
(0.043001, -0.0236368, 0.19351),(0.0478462, -0.0221909, 0.226739),(0.0793398, -0.00996892, 0.252921),
(0.0490575, -0.0121994, 0.251384),(0.0478462, 0.00052838, 0.273967),(0.0502688, 0.0124132, 0.302548),
(0.0526913, 0.0239804, 0.342093),(0.0490575, 0.0666634, 0.430046),(0.0490575, 0.0441515, 0.398749),
(0.0841851, 0.0532224, 0.395131),(0.0817625, 0.0294527, 0.337969),(0.0793398, 0.0185793, 0.302192),
(0.0793398, 0.00189648, 0.272936),(0.233174, 0.0867438, 0.0695779),(0.245287, 0.0951987, 0.0964533),
(0.202892, 0.0578649, 0.100992),(0.188356, 0.0562504, 0.0689619),(0.142327, 0.0448583, 0.106503),
(0.137482, 0.0461681, 0.0797769),(0.113256, 0.0489237, 0.0862802),(-0.265879, 0.130322, 0.0989431),
(-0.230752, 0.0850386, 0.0730078),(-0.212582, 0.085674, 0.0510795),(-0.184723, 0.0547137, 0.0711924),
(-0.176243, 0.0623776, 0.051475),(-0.133848, 0.0446314, 0.0820074),(-0.11689, 0.0526324, 0.059891),
(-0.0853963, 0.059006, 0.0754652),(0.113256, 0.0489237, 0.0862802),(0.0914528, 0.0510439, 0.114712),
(0.119313, 0.0540005, 0.0588601),(0.137482, 0.0461681, 0.0797769),(0.188356, 0.0562504, 0.0689619),
(0.178666, 0.0639143, 0.0492446),(0.233174, 0.0867438, 0.0695779),(0.215005, 0.0873793, 0.0476496),
(0.268302, 0.132027, 0.0955132),(-0.0648043, -0.10543, -0.0687416),(-0.0345219, -0.104756, -0.0735396),
(-0.0478462, -0.0981034, -0.0860599),(-0.0526913, -0.134348, -0.0544577),(-0.0466349, -0.143438, -0.0594049),
(-0.0369445, -0.14089, -0.0688324),(-0.0345219, -0.111655, -0.0940804),(0.0369445, -0.104756, -0.0735396),
(0.0684382, -0.116375, -0.0604942),(0.0672269, -0.105262, -0.0699411),(0.0502688, -0.0979348, -0.0872594),
(0.0369445, -0.111655, -0.0940804),(-0.135059, -0.0168676, -0.220204),(-0.150806, -0.0207644, -0.20118),
(-0.0999319, -0.0514458, -0.209162),(-0.0720721, -0.0957303, -0.172574),(-0.0660156, -0.0767846, -0.202937),
(-0.0442123, -0.112167, -0.168768),(-0.0381558, -0.0906535, -0.199994),(-0.0175638, -0.117996, -0.17081),
(-0.0163525, -0.0961453, -0.204435),(0.000605662, -0.118164, -0.16961),(0.000605662, -0.0939149, -0.202898),
(0.018775, -0.117996, -0.17081),(0.0163525, -0.0961453, -0.204435),(0.0381558, -0.0906535, -0.199994),
(0.0732834, -0.0955618, -0.173773),(0.0660156, -0.076616, -0.204137),(0.112045, -0.0661187, -0.18309),
(0.0999319, -0.0512772, -0.210361),(0.135059, -0.0153309, -0.222434),(0.150806, -0.0192277, -0.203411),
(-0.102355, -0.0591875, -0.223705),(-0.0769173, -0.0865881, -0.220217),(-0.0805511, -0.0909193, -0.24162),
(-0.043001, -0.107148, -0.221883),(-0.0417897, -0.11251, -0.244654),(-0.0175638, -0.108685, -0.219652),
(0.000605662, -0.110053, -0.218622),(0.0175638, -0.108685, -0.219652),(0.043001, -0.10698, -0.223083),
(0.0417897, -0.11251, -0.244654),(0.0769172, -0.0864195, -0.221416),(0.0805511, -0.0907507, -0.242819),
(0.102354, -0.0590189, -0.224904),(0.108411, -0.061794, -0.239973)
);

const normals : Array[0..536, 0..2] of Single = (
(-0.617258, -0.265442, 0.740631),(-0.78174, -0.349396, 0.516531),(-0.876403, -0.187631, 0.443523),
(-0.392622, -0.66733, 0.632865),(-0.313203, -0.686293, 0.656434),(-0.00361883, -0.700253, 0.713886),
(0.0420161, -0.799516, 0.599174),(-0.40127, -0.74323, 0.535342),(-0.815972, -0.462599, 0.346687),
(-0.617717, -0.683678, 0.388601),(-0.913548, -0.308706, 0.26482),(-0.898646, -0.378167, 0.222316),
(-0.837402, -0.470289, 0.278544),(-0.931079, -0.205564, 0.301388),(-0.917233, -0.387337, -0.0930287),
(-0.619272, -0.570823, -0.539132),(-0.715003, -0.436717, -0.545939),(-0.769001, -0.466214, -0.437358),
(-0.696899, -0.546775, -0.464078),(-0.87295, -0.477816, -0.0982331),(-0.28788, -0.921155, 0.261913),
(-0.275797, -0.960154, 0.0451773),(-0.0414261, -0.928196, 0.369778),(-0.353936, -0.843672, -0.403667),
(-0.184309, -0.751164, -0.633863),(0.0475635, -0.976025, -0.2124),(-0.351521, -0.852575, -0.386715),
(-0.430588, -0.871166, -0.235933),(-0.509535, -0.769058, -0.385907),(-0.657016, -0.685816, -0.313028),
(-0.704687, -0.607631, -0.366335),(-0.779863, -0.555723, -0.28807),(-0.835802, -0.476563, -0.272622),
(-0.866963, -0.480579, -0.131978),(-0.784759, -0.614786, 0.0786812),(-0.81366, -0.540176, 0.214866),
(-0.758468, -0.572999, 0.310481),(-0.555739, -0.691157, 0.462012),(-0.498867, -0.757042, 0.421922),
(-0.371277, -0.825802, 0.424505),(-0.36783, -0.801439, 0.47159),(-0.574546, -0.717391, 0.394015),
(-0.905637, -0.404294, 0.127934),(-0.852918, -0.507032, 0.124293),(-0.647028, -0.748724, 0.144109),
(-0.441598, -0.879427, 0.177764),(-0.734821, -0.622713, 0.268824),(-0.912944, -0.281633, 0.295325),
(-0.926242, -0.295736, 0.233702),(-0.861139, -0.388918, 0.327388),(-0.888772, -0.207712, 0.408582),
(-0.93923, -0.249894, 0.235373),(-0.858942, -0.275798, 0.431456),(-0.817378, -0.368817, -0.44257),
(-0.801257, -0.115027, -0.587159),(-0.732909, -0.412067, -0.541337),(-0.649453, -0.665807, 0.367302),
(-0.730957, -0.621653, 0.281511),(-0.64689, -0.682982, 0.339218),(-0.638983, -0.762274, 0.10315),
(-0.667779, -0.738635, -0.0921354),(-0.746946, -0.652356, -0.128463),(-0.5818, -0.762069, 0.284181),
(-0.553142, -0.796434, -0.244393),(-0.684545, -0.488, -0.541529),(-0.508918, -0.610183, 0.60719),
(-0.0489265, -0.676034, 0.735244),(-0.465952, -0.628122, 0.623178),(0.0472658, -0.752373, 0.65704),
(-0.841097, -0.341672, 0.419305),(-0.792787, -0.398602, 0.46109),(-0.748569, -0.659751, -0.0661367),
(-0.504802, -0.721122, 0.474508),(-0.639641, -0.384767, -0.665442),(-0.829025, -0.489687, -0.270043),
(-0.836672, -0.486351, -0.251877),(-0.801163, -0.510555, -0.312203),(-0.834725, -0.461526, -0.300379),
(-0.291522, -0.804713, -0.517158),(-0.44811, -0.67301, -0.588434),(-0.508016, -0.652204, -0.562628),
(-0.545984, -0.586857, -0.597913),(-0.493538, -0.61943, -0.610514),(-0.390347, -0.791894, -0.46961),
(-0.596257, -0.662142, -0.453922),(-0.466572, -0.79986, 0.377536),(0.190036, -0.838769, 0.510248),
(-0.496608, -0.863239, -0.0905465),(-0.0583197, -0.82638, -0.560085),(0.0972804, -0.903582, -0.417223),
(0.00449633, -0.781011, -0.624501),(-0.0830325, -0.903347, -0.420796),(-0.151122, -0.987776, 0.0382124),
(-0.232497, -0.968684, 0.0871632),(-0.088527, -0.912191, 0.400088),(0.0222154, -0.918755, 0.394203),
(-0.0112384, -0.918665, 0.394878),(-0.278235, -0.895706, 0.346836),(-0.562816, -0.77036, 0.299639),
(-0.669247, -0.683012, 0.292579),(-0.74378, -0.644853, 0.17594),(-0.579577, -0.814631, -0.0216126),
(-0.755464, -0.653803, -0.0426144),(-0.233861, -0.914594, 0.329888),(-0.225782, -0.900613, -0.371375),
(-0.756949, -0.652254, 0.0399106),(-0.761632, -0.566077, 0.315394),(0.0, -0.829005, -0.559241),
(-0.0941706, -0.799439, -0.593321),(-0.0209907, -0.956621, -0.290578),(-0.228631, -0.855488, -0.464615),
(-0.281067, -0.747786, -0.601513),(-0.48714, -0.786955, -0.378677),(-0.397781, -0.837273, -0.375158),
(-0.637666, -0.735249, -0.229764),(-0.704007, -0.698655, -0.127498),(-0.567297, -0.810598, -0.145276),
(-0.414329, -0.905828, -0.0883625),(-0.285415, -0.958382, 0.0065404),(-0.280812, -0.94687, 0.156787),
(0.0201945, -0.991659, 0.127301),(-0.444322, -0.88464, 0.141385),(-0.595259, -0.794994, 0.116837),
(-0.725363, -0.688227, 0.0138487),(-0.824385, -0.547202, -0.144774),(-0.79484, -0.594072, -0.123723),
(-0.842585, -0.530194, -0.0945766),(-0.925218, -0.378386, -0.0282201),(-0.886118, -0.435693, -0.158009),
(-0.820206, -0.526702, -0.223266),(-0.849571, -0.4593, -0.259369),(-0.836279, -0.479526, -0.265879),
(-0.83314, -0.488901, -0.25856),(-0.82904, -0.490977, -0.267646),(-0.841809, -0.471393, -0.262955),
(-0.659415, -0.355956, -0.662168),(-0.675727, -0.266966, -0.687111),(-0.812794, -0.389938, -0.432798),
(-0.495016, -0.200544, -0.845424),(-0.683747, -0.294463, -0.667669),(-0.451368, -0.223791, -0.86382),
(-0.791228, -0.451898, -0.412003),(-0.826905, -0.524712, -0.202251),(-0.830356, -0.490117, -0.265131),
(-0.771985, -0.610672, -0.176406),(-0.281292, -0.938959, -0.19807),(0.0528991, -0.99578, 0.0749901),
(-0.162494, -0.628418, -0.760715),(0.00113543, -0.813339, -0.581788),(0.00874717, -0.607383, -0.794361),
(0.0171233, -0.315803, -0.94867),(-0.148415, -0.264319, -0.952947),(-0.369791, -0.363335, -0.855127),
(-0.457739, -0.675978, -0.57752),(-0.504461, -0.852615, -0.136258),(-0.654036, -0.733626, -0.184473),
(-0.63544, -0.480484, -0.604442),(0.00534621, -0.183511, -0.983003),(-0.149748, -0.172462, -0.973567),
(-0.0487523, -0.182016, -0.982086),(-0.176473, -0.181106, -0.967501),(-0.276192, -0.176149, -0.944822),
(-0.309419, -0.179765, -0.93378),(-0.926717, -0.362956, -0.0972538),(-0.715187, -0.590702, -0.373602),
(-0.934949, -0.344579, 0.0844686),(-0.886194, -0.377255, 0.268957),(-0.882874, -0.339461, 0.324499),
(-0.724306, -0.556794, 0.406647),(-0.694368, -0.594899, 0.404905),(-0.89851, -0.387601, 0.206024),
(-0.836716, -0.479611, 0.264347),(-0.813134, -0.530495, 0.239556),(-0.735221, -0.568519, 0.369102),
(-0.721289, -0.63864, 0.268104),(-0.548249, -0.79382, -0.263196),(-0.50025, -0.860456, 0.0967749),
(-0.566133, -0.731919, 0.379193),(-0.569417, -0.6968, 0.436158),(-0.601395, -0.724978, 0.335755),
(-0.620227, -0.707055, 0.339693),(-0.738127, -0.58567, 0.334902),(-0.790837, -0.511147, 0.336609),
(-0.727633, -0.511907, 0.45662),(-0.619302, -0.611804, 0.492099),(-0.462961, -0.81736, 0.342912),
(-0.655225, -0.522961, 0.545153),(-0.500154, -0.56028, 0.660252),(-0.363982, -0.412211, 0.835224),
(-0.331048, -0.549598, 0.767039),(-0.497904, -0.502297, 0.706958),(-0.301391, -0.353697, 0.885473),
(-0.294971, -0.326452, 0.89801),(-0.340904, -0.357128, 0.869623),(-0.262921, -0.27268, 0.925483),
(-0.152911, -0.365596, 0.918127),(-0.0627082, -0.23129, 0.970862),(-0.0142343, -0.361908, 0.932105),
(0.0229022, -0.223247, 0.974493),(-0.13005, -0.573671, 0.808696),(0.0154897, -0.643634, 0.765177),
(-0.338543, -0.580818, 0.740297),(-0.500555, -0.692847, 0.519045),(-0.406601, -0.809554, 0.423435),
(-0.384567, -0.79993, 0.460673),(-0.40446, -0.849816, 0.337972),(-0.373225, -0.921929, 0.103685),
(-0.211716, -0.976661, -0.0362004),(-0.233625, -0.958946, 0.160757),(-0.536151, -0.49527, -0.683556),
(-0.128299, -0.991665, 0.0118411),(-0.00909901, -0.996933, 0.0777355),(-0.0708222, -0.977629, 0.198052),
(0.0173543, -0.974417, 0.224075),(-0.163346, -0.895824, 0.413301),(-0.0294524, -0.900433, 0.433997),
(-0.00885682, -0.898802, 0.438265),(-0.0623815, -0.887307, 0.456941),(0.00210282, -0.907103, 0.420902),
(-0.124547, -0.937855, 0.323906),(0.00511924, -0.945417, 0.325822),(-0.11412, -0.946355, 0.302305),
(0.00780987, -0.949634, 0.313265),(-0.158107, -0.750921, 0.641186),(0.0148427, -0.864096, 0.503109),
(-0.148108, -0.891512, 0.428102),(-0.349961, -0.802187, 0.483759),(-0.272668, -0.91094, 0.309581),
(-0.243777, -0.896929, 0.368905),(-0.19127, -0.843408, 0.502075),(0.0757574, -0.978436, -0.192154),
(-0.747236, -0.610472, -0.262607),(-0.685706, -0.715288, -0.134801),(-0.739627, -0.668704, -0.0760731),
(-0.422988, -0.903717, -0.0661576),(-0.374275, -0.919054, -0.123525),(-0.0416223, -0.999112, -0.00659359),
(-0.0516061, -0.998629, 0.00881155),(-0.088891, -0.994828, -0.0491407),(0.135923, -0.990655, -0.011341),
(0.876403, -0.187631, 0.443523),(0.787758, -0.344726, 0.510491),(0.624007, -0.265876, 0.734796),
(0.409136, -0.662313, 0.627655),(0.445411, -0.650182, 0.615526),(0.31458, -0.765384, 0.56145),
(0.849667, -0.433274, 0.300565),(0.816138, -0.51399, 0.264069),(0.918661, -0.300741, 0.256159),
(0.910694, -0.35184, 0.216437),(0.853339, -0.453024, 0.258032),(0.921765, -0.376911, -0.0910378),
(0.715003, -0.436717, -0.545938),(0.621854, -0.56999, -0.537037),(0.624665, -0.569432, -0.53436),
(0.774832, -0.460815, -0.432764),(0.341366, -0.933137, 0.1128),(0.231637, -0.928159, 0.291316),
(0.361349, -0.840156, -0.404432),(-0.0338424, -0.975414, -0.217767),(0.1775, -0.924191, -0.338178),
(0.34746, -0.840154, -0.416429),(0.454658, -0.84617, -0.277996),(0.422169, -0.819544, -0.387454),
(0.707892, -0.661494, -0.247617),(0.623741, -0.655536, -0.4257),(0.802222, -0.54216, -0.250005),
(0.78433, -0.501428, -0.365235),(0.86367, -0.480751, -0.151499),(0.788122, -0.611174, 0.073002),
(0.765777, -0.566054, 0.305235),(0.823679, -0.529652, 0.202539),(0.56034, -0.687978, 0.4612),
(0.51691, -0.747974, 0.416339),(0.382841, -0.822727, 0.420182),(0.38099, -0.795981, 0.470384),
(0.582043, -0.714302, 0.388584),(0.914053, -0.387134, 0.120975),(0.85754, -0.501725, 0.113568),
(0.651321, -0.747094, 0.132783),(0.451688, -0.87571, 0.170619),(0.743327, -0.616865, 0.258734),
(0.923842, -0.252524, 0.28766),(0.842955, -0.41534, 0.341936),(0.924753, -0.310324, 0.220298),
(0.897888, -0.220893, 0.380793),(0.944496, -0.23874, 0.225679),(0.805719, -0.260089, 0.532138),
(0.863186, -0.339809, -0.373417),(0.689858, -0.419248, -0.590192),(0.801257, -0.115027, -0.587159),
(0.74902, -0.611687, 0.254576),(0.660063, -0.663575, 0.352115),(0.656186, -0.678964, 0.329285),
(0.649105, -0.754651, 0.0957276),(0.751431, -0.645607, -0.136169),(0.668579, -0.736547, -0.10247),
(0.591109, -0.75917, 0.27249),(0.614646, -0.755492, -0.226808),(0.663605, -0.544789, -0.512673),
(0.470876, -0.620339, 0.62726),(0.609384, -0.561506, 0.559787),(0.829197, -0.361003, 0.426743),
(0.805566, -0.438566, 0.398401),(0.828509, -0.391222, 0.400647),(0.524036, -0.688124, 0.501868),
(0.606937, -0.475749, -0.636624),(0.828344, -0.483055, -0.283731),(0.789551, -0.537867, -0.295481),
(0.817378, -0.510371, -0.267235),(0.766699, -0.571075, -0.293336),(0.69986, -0.567855, -0.433285),
(0.459905, -0.705019, -0.539848),(0.567305, -0.454808, -0.686524),(0.503006, -0.560716, -0.65771),
(0.674924, -0.471443, -0.567643),(0.388663, -0.812261, -0.43494),(0.591096, -0.666781, -0.453882),
(0.598151, -0.797473, 0.079072),(0.13697, -0.908961, -0.393737),(0.270638, -0.960037, 0.0713018),
(0.0735647, -0.923874, 0.37556),(0.0290081, -0.917232, 0.397295),(0.380773, -0.863632, 0.330381),
(0.569613, -0.765046, 0.30041),(0.679429, -0.67734, 0.282112),(0.753698, -0.635435, 0.167813),
(0.584434, -0.81106, -0.024858),(0.76412, -0.643387, -0.0466274),(0.23386, -0.914594, 0.329888),
(0.225783, -0.900612, -0.371375),(0.767506, -0.558783, 0.314159),(0.763628, -0.642974, 0.0587918),
(0.0926679, -0.799211, -0.593864),(0.215414, -0.846969, -0.486045),(0.274782, -0.749427, -0.602373),
(0.487849, -0.789001, -0.373472),(0.348666, -0.857005, -0.379439),(0.624288, -0.739893, -0.250644),
(0.709683, -0.689885, -0.142858),(0.584196, -0.809383, -0.0601197),(0.43716, -0.895401, -0.0845524),
(0.232516, -0.969818, -0.0734126),(0.294443, -0.946238, 0.133928),(0.488417, -0.862019, 0.135543),
(0.624279, -0.775634, 0.0931067),(0.714001, -0.699448, 0.0312114),(0.830263, -0.542886, -0.126245),
(0.798836, -0.5863, -0.134587),(0.841905, -0.528472, -0.10915),(0.927469, -0.371869, -0.0389304),
(0.884396, -0.43335, -0.17335),(0.816303, -0.53092, -0.227539),(0.840914, -0.465251, -0.276413),
(0.832573, -0.483116, -0.270962),(0.83747, -0.481863, -0.257782),(0.841636, -0.468362, -0.268862),
(0.83038, -0.474839, -0.291543),(0.801153, -0.399291, -0.445782),(0.707022, -0.27507, -0.651503),
(0.654272, -0.336121, -0.677459),(0.52269, -0.200702, -0.828561),(0.664579, -0.310645, -0.679584),
(0.417023, -0.197468, -0.887186),(0.785597, -0.444629, -0.430281),(0.828569, -0.519048, -0.209911),
(0.835037, -0.402666, -0.374932),(0.777287, -0.587223, -0.225819),(0.26732, -0.912463, -0.309761),
(0.172765, -0.654482, -0.736074),(0.110771, -0.330093, -0.937426),(0.353687, -0.327582, -0.876125),
(0.453273, -0.674334, -0.582939),(0.492896, -0.863008, -0.110777),(0.662357, -0.723987, -0.192679),
(0.624803, -0.514211, -0.587544),(0.156434, -0.179064, -0.971321),(0.150117, -0.189905, -0.970258),
(0.281753, -0.178067, -0.942819),(0.256982, -0.181656, -0.94919),(0.940752, -0.33189, -0.0695256),
(0.88295, -0.469076, -0.0191461),(0.930368, -0.350438, 0.107748),(0.888408, -0.37068, 0.270791),
(0.664591, -0.746989, 0.0180683),(0.744024, -0.508835, 0.433031),(0.903612, -0.39329, 0.169729),
(0.854724, -0.468037, 0.224475),(0.837051, -0.494926, 0.233225),(0.761458, -0.597303, 0.251815),
(0.745746, -0.565203, 0.352715),(0.4608, -0.887491, 0.00483841),(0.571511, -0.728248, 0.378194),
(0.607898, -0.648542, 0.458097),(0.620049, -0.717175, 0.318119),(0.725479, -0.602636, 0.33243),
(0.641451, -0.672823, 0.368578),(0.803061, -0.521387, 0.288527),(0.722356, -0.545386, 0.425153),
(0.635353, -0.613878, 0.468487),(0.479295, -0.811954, 0.333177),(0.661515, -0.522284, 0.538161),
(0.573405, -0.534753, 0.620682),(0.39978, -0.411405, 0.819098),(0.415027, -0.362971, 0.834269),
(0.508203, -0.506784, 0.696347),(0.265104, -0.414504, 0.870578),(0.347009, -0.310028, 0.885137),
(0.290459, -0.332304, 0.897334),(0.245608, -0.272773, 0.9302),(0.132495, -0.254239, 0.958023),
(0.127065, -0.358715, 0.924758),(0.179434, -0.567561, 0.803541),(0.380897, -0.575571, 0.723627),
(0.527195, -0.66472, 0.529352),(0.446801, -0.797967, 0.404497),(0.411305, -0.781925, 0.468424),
(0.385759, -0.862342, 0.327957),(0.362719, -0.927128, 0.0941715),(0.250393, -0.966572, -0.0551604),
(0.186457, -0.969054, 0.161767),(0.115126, -0.99326, 0.0134715),(0.0874802, -0.975042, 0.204061),
(0.222141, -0.906262, 0.359643),(0.0561565, -0.901977, 0.428117),(0.0787259, -0.898121, 0.432644),
(0.1142, -0.942658, 0.313616),(0.131356, -0.942377, 0.307688),(0.167886, -0.755912, 0.632781),
(0.173902, -0.879794, 0.442404),(0.35749, -0.800645, 0.480801),(0.294308, -0.903121, 0.312659),
(0.253163, -0.892896, 0.372351),(0.17347, -0.857544, 0.484278),(-0.0757568, -0.978436, -0.192153),
(0.747236, -0.610472, -0.262608),(0.718274, -0.687115, -0.109342),(0.713624, -0.692815, -0.103677),
(0.454722, -0.888939, -0.0549079),(0.405268, -0.909355, -0.093972),(0.0393733, -0.998888, -0.0259197),
(0.0289558, -0.998112, -0.0541624),(-0.122061, -0.992232, -0.0239979),(-0.747724, -0.221519, -0.62597),
(-0.364423, -0.814637, -0.45118),(-0.50591, -0.741525, -0.440676),(-0.486892, -0.739799, -0.464364),
(-0.223409, -0.87127, -0.43701),(-0.0084065, -0.939114, -0.343502),(0.129522, -0.946177, -0.296602),
(0.277692, -0.936688, -0.213313),(0.33294, -0.919698, -0.208101),(0.354961, -0.920425, -0.163769),
(-0.311673, -0.934987, -0.169288),(-0.295124, -0.933917, -0.201745),(-0.252945, -0.945166, -0.206589),
(-0.0679037, -0.944385, -0.321756),(-0.0388748, -0.946409, -0.320622),(0.227365, -0.861564, -0.453885),
(0.35972, -0.815078, -0.454146),(0.5967, -0.591085, -0.542741),(0.479351, -0.770859, -0.419522),
(0.747723, -0.221516, -0.625973),(0.0791356, 0.788253, 0.610242),(0.0478053, 0.902264, 0.428526),
(0.175119, 0.532711, 0.827981),(0.481044, 0.24705, 0.841168),(0.639205, 0.140618, 0.756071),
(0.684795, 0.0511888, 0.726936),(0.765029, 0.0324948, 0.643176),(0.830765, 0.0167793, 0.55637),
(0.912871, 0.387004, -0.129978),(0.785802, 0.586295, -0.196911),(0.611315, 0.750206, -0.251962),
(-0.71794, 0.0382936, 0.695051),(-0.830766, 0.0167803, 0.556369),(-0.742164, 0.0374156, 0.669173),
(-0.6528, 0.0485878, 0.75597),(-0.150987, 0.528618, 0.835324),(-0.116243, 0.681696, 0.722342),
(-0.464006, 0.2329, 0.854667),(-0.0587127, 0.793589, 0.605615),(-0.0344926, 0.907858, 0.417856),
(-0.793461, 0.57695, -0.193773),(-0.63088, 0.735506, -0.247026),(-0.912871, 0.387004, -0.129978),
(-0.45388, -0.682342, -0.573063),(-0.50651, -0.66027, -0.554519),(-0.488508, -0.662074, -0.568346),
(-0.431235, -0.701918, -0.566876),(-0.397616, -0.731501, -0.553903),(-0.374918, -0.743146, -0.55423),
(-0.300544, -0.764968, -0.569646),(-0.279219, -0.777606, -0.563352),(-0.166736, -0.813821, -0.556681),
(-0.0411986, -0.826303, -0.561717),(0.0516586, -0.817722, -0.57329),(-0.0145019, -0.820442, -0.571546),
(-5.91482e-05, -0.828223, -0.560399),(0.115718, -0.81337, -0.570122),(0.285503, -0.761253, -0.582222),
(0.320216, -0.745381, -0.584696),(0.356785, -0.74091, -0.568997),(0.382445, -0.73484, -0.56013),
(0.457103, -0.688275, -0.563325),(0.451517, -0.684089, -0.572848),(0.493987, -0.661223, -0.56459),
(0.507059, -0.659586, -0.554831),(-0.661296, -0.606156, 0.441885),(-0.64427, -0.62539, 0.440231),
(-0.698814, -0.575222, 0.425181),(-0.660193, -0.619895, 0.424118),(-0.538153, -0.683186, 0.493608),
(-0.533918, -0.611364, 0.584094),(-0.58478, -0.761404, 0.279814),(-0.27925, -0.855024, 0.436983),
(-0.291199, -0.725103, 0.624042),(-0.246496, -0.937821, 0.244401),(-0.0854134, -0.870025, 0.485552),
(-0.044095, -0.776621, 0.628423),(-0.090252, -0.952923, 0.28947),(-0.00305904, -0.870387, 0.492359),
(-0.0258982, -0.723835, 0.689487),(0.0308592, -0.965536, 0.258435),(0.0841051, -0.883264, 0.461271),
(0.0450932, -0.745049, 0.665484),(0.0962614, -0.95454, 0.282112),(0.325467, -0.851067, 0.412014),
(0.213178, -0.762191, 0.611245),(0.331889, -0.91808, 0.216747),(0.593694, -0.671407, 0.443553),
(0.450167, -0.642781, 0.619824),(0.554443, -0.798252, 0.235344),(0.707397, -0.577409, 0.407662),
(0.650872, -0.570267, 0.50116),(0.70501, -0.617847, 0.348175),(0.72034, -0.562219, 0.406227)
);

implementation

end.


 
调用贴图:
unit BMP;

interface

uses
Windows, OpenGL;

function LoadTexture(Filename: String; var Texture: GLuint): Boolean;

implementation


function gluBuild2DMipmaps(Target: GLenum; Components, Width, Height: GLint; Format, atype: GLenum; Data: Pointer): GLint; stdcall; external glu32;
procedure glGenTextures(n: GLsizei; var textures: GLuint); stdcall; external opengl32;
procedure glBindTexture(target: GLenum; texture: GLuint); stdcall; external opengl32;


{------------------------------------------------------------------}
{ Swap bitmap format from BGR to RGB }
{------------------------------------------------------------------}
procedure SwapRGB(data : Pointer; Size : Integer);
asm
mov ebx, eax
mov ecx, size

@@loop :
mov al,[ebx+0]
mov ah,[ebx+2]
mov [ebx+2],al
mov [ebx+0],ah
add ebx,3
dec ecx
jnz @@loop
end;


{------------------------------------------------------------------}
{ Load BMP file }
{------------------------------------------------------------------}
procedure LoadBitmap(Filename: String; out Width: Cardinal; out Height: Cardinal; out pData: Pointer);
var
FileHeader: TBITMAPFILEHEADER;
InfoHeader: TBITMAPINFOHEADER;
Palette: array of RGBQUAD;
BitmapFile: THandle;
BitmapLength: LongWord;
PaletteLength: LongWord;
ReadBytes: LongWord;
begin
BitmapFile := CreateFile(PChar(Filename), GENERIC_READ, FILE_SHARE_READ, nil, OPEN_EXISTING, 0, 0);
if (BitmapFile = INVALID_HANDLE_VALUE) then begin
MessageBox(0, PChar('Error opening "' + Filename), PChar('BMP Unit'), MB_OK);
Exit;
end;

// Get header information
ReadFile(BitmapFile, FileHeader, SizeOf(FileHeader), ReadBytes, nil);
ReadFile(BitmapFile, InfoHeader, SizeOf(InfoHeader), ReadBytes, nil);

// Get palette
PaletteLength := InfoHeader.biClrUsed;
SetLength(Palette, PaletteLength);
ReadFile(BitmapFile, Palette, PaletteLength, ReadBytes, nil);
if (ReadBytes <> PaletteLength) then begin
MessageBox(0, PChar('Error reading palette'), PChar('BMP Unit'), MB_OK);
Exit;
end;

Width := InfoHeader.biWidth;
Height := InfoHeader.biHeight;
BitmapLength := InfoHeader.biSizeImage;
if BitmapLength = 0 then
BitmapLength := Width * Height * InfoHeader.biBitCount Div 8;

// Get the actual pixel data
GetMem(pData, BitmapLength);
ReadFile(BitmapFile, pData^, BitmapLength, ReadBytes, nil);
if (ReadBytes <> BitmapLength) then begin
MessageBox(0, PChar('Error reading bitmap data'), PChar('BMP Unit'), MB_OK);
Exit;
end;
CloseHandle(BitmapFile);

// Bitmaps are stored BGR and not RGB, so swap the R and B bytes.
SwapRGB(pData, Width*Height);
end;


{------------------------------------------------------------------}
{ Load BMP textures }
{------------------------------------------------------------------}
function LoadTexture(Filename: String; var Texture: GLuint): Boolean;
var
pData: Pointer;
Width: LongWord;
Height: LongWord;
begin
pData :=nil;
LoadBitmap(Filename, Width, Height, pData);

if (Assigned(pData)) then
Result := True
else
begin
Result := False;
MessageBox(0, PChar('Unable to load ' + filename), 'Loading Textures', MB_OK);
Halt(1);
end;

glGenTextures(1, Texture);
glBindTexture(GL_TEXTURE_2D, Texture);
glTexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE); {Texture blends with object background}
// glTexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_DECAL); {Texture does NOT blend with object background}

{ Select a filtering type. BiLinear filtering produces very good results with little performance impact
GL_NEAREST - Basic texture (grainy looking texture)
GL_LINEAR - BiLinear filtering
GL_LINEAR_MIPMAP_NEAREST - Basic mipmapped texture
GL_LINEAR_MIPMAP_LINEAR - BiLinear Mipmapped texture
}

glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR); { only first two can be used }
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR); { all of the above can be used }

gluBuild2DMipmaps(GL_TEXTURE_2D, 3, Width, Height, GL_RGB, GL_UNSIGNED_BYTE, pData);
// glTexImage2D(GL_TEXTURE_2D, 0, 3, Width, Height, 0, GL_RGB, GL_UNSIGNED_BYTE, pData); // Use when not wanting mipmaps to be built by openGL
end;

end.
 
生成三维图形(一张脸)主程序:
//---www.huasoft.net
program chromeface;

uses
Windows,
Messages,
OpenGL,
face_data,
BMP;

const
WND_TITLE = 'OpenGL App by Jan Horn';
FPS_TIMER = 1; // Timer to calculate FPS
FPS_INTERVAL = 250; // Calculate FPS every 1000 ms

var
h_Wnd : HWND; // Global window handle
h_DC : HDC; // Global device context
h_RC : HGLRC; // OpenGL rendering context
keys : Array[0..255] of Boolean; // Holds keystrokes
FPSCount : Integer = 0; // Counter for FPS
ElapsedTime : Integer; // Elapsed time between frames

// Textures
EnviroMapTex : glUint;
RenderedTex : glUint;

// User vaiables
Wireframe : Boolean;
FaceDL : glUint;
FaceCount : Integer;

procedure glBindTexture(target: GLenum; texture: GLuint); stdcall; external opengl32;
procedure glGenTextures(n: GLsizei; var textures: GLuint); stdcall; external opengl32;
procedure glCopyTexImage2D(target: GLEnum; level: GLint; internalFormat: GLEnum; x, y: GLint; width, height: GLsizei; border: GLint); stdcall; external opengl32;

{------------------------------------------------------------------}
{ Function to convert int to string. (No sysutils = smaller EXE) }
{------------------------------------------------------------------}
function IntToStr(Num : Integer) : String; // using SysUtils increase file size by 100K
begin
Str(Num, result);
end;


{------------------------------------------------------------------}
{ Function to create a blank texture to be used for blur }
{------------------------------------------------------------------}
procedure CreateRenderTexture;
var pData: Pointer;
begin
// allocate memory for a 512x512 texture
GetMem(pData, 128*128*3);

glGenTextures(1, RenderedTex);
glBindTexture(GL_TEXTURE_2D, RenderedTex);
glTexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE); {Texture blends with object background}

glTexImage2D(GL_TEXTURE_2D, 0, 3, 128, 128, 0, GL_RGB, GL_UNSIGNED_BYTE, pData); // Use when not wanting mipmaps to be built by openGL
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR); { only first two can be used }
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR); { all of the above can be used }

FreeMem(pData);
end;


{------------------------------------------------------------------}
{ procedure to create a display list of the face }
{------------------------------------------------------------------}
procedure createFaceDisplayList;
var I, J : Integer;
begin
FaceDL :=glGenLists(1);
glNewList(FaceDL, GL_COMPILE);
glEnable(GL_TEXTURE_GEN_S); // Enable spherical
glEnable(GL_TEXTURE_GEN_T); // Environment Mapping
glEnable(GL_CULL_FACE);
glRotate(-90, 1, 0, 0);
glBegin(GL_TRIANGLES);
For I :=0 to numTriangles-1 do
begin
glNormal3f(normals[ Face[i,3],0], normals[ Face[i,3],1], normals[ Face[i,3],2]);
glVertex3f(vertices[Face[i,0],0], vertices[Face[i,0],1], vertices[Face[i,0],2]);

glNormal3f(normals[ Face[i,4],0], normals[ Face[i,4],1], normals[ Face[i,4],2]);
glVertex3f(vertices[Face[i,1],0], vertices[Face[i,1],1], vertices[Face[i,1],2]);

glNormal3f(normals[ Face[i,5],0], normals[ Face[i,5],1], normals[ Face[i,5],2]);
glVertex3f(vertices[Face[i,2],0], vertices[Face[i,2],1], vertices[Face[i,2],2]);
end;
glEnd();
glDisable(GL_CULL_FACE);
glDisable(GL_TEXTURE_GEN_S); // Disable spherical
glDisable(GL_TEXTURE_GEN_T); // Environment Mapping
glEndList();
end;


{------------------------------------------------------------------}
{ Function to draw the actual scene }
{------------------------------------------------------------------}
procedure glDraw();
var I : Integer;
X, Y : glFloat;
begin
glClear(GL_COLOR_BUFFER_BIT or GL_DEPTH_BUFFER_BIT); // Clear The Screen And The Depth Buffer
glLoadIdentity(); // Reset The View

// Render the scene in a 128x128 viewport
glViewport(-50, 0, 160, 120);
glPushMatrix();
glTranslatef(0.2, 0.0, -1.4);
glRotatef(30*cos(Elapsedtime/300)+5, 1, 0, 0);
glRotatef(30*sin(Elapsedtime/300), 0, 1, 0);

glBindTexture(GL_TEXTURE_2D, EnviroMapTex);
glCallList(FaceDL);
glPopMatrix();

// Grab the scene as a texture
glBindTexture(GL_TEXTURE_2D, RenderedTex);
glCopyTexImage2D(GL_TEXTURE_2D, 0, GL_RGB, 0, 0, 128, 128, 0);


// DRAW the new texture on a lot of quads
// resize viewport to fill screen
glViewport(0, 0, 800, 600);
glTranslatef(0.0, 0.0, -12.0);

for I :=0 to FaceCount do
begin
X :=4*sin(-ElapsedTime/500 + I/3) + 2*cos(ElapsedTime/1300 + I/7);
Y :=3.8*cos(-ElapsedTime/900 + I/5);
glBegin(GL_QUADS);
glTexCoord2f(0, 0); glVertex3f(X-1,Y-1, -I/10);
glTexCoord2f(1, 0); glVertex3f(X+1,Y-1, -I/10);
glTexCoord2f(1, 1); glVertex3f(X+1,Y+1, -I/10);
glTexCoord2f(0, 1); glVertex3f(X-1,Y+1, -I/10);
glEnd();
end;
end;


{------------------------------------------------------------------}
{ Initialise OpenGL }
{------------------------------------------------------------------}
procedure glInit();
begin
// glClearColor(0.2, 0.2, 0.4, 0.0); // Black Background
glClearColor(0.0, 0.0, 0.0, 0.0); // Black Background
glShadeModel(GL_SMOOTH); // Enables Smooth Color Shading
glClearDepth(1.0); // Depth Buffer Setup
glEnable(GL_DEPTH_TEST); // Enable Depth Buffer
glDepthFunc(GL_LESS); // The Type Of Depth Test To Do
glDisable(GL_DEPTH_TEST);
glEnable(GL_BLEND);
glBlendFunc(GL_SRC_ALPHA, GL_ONE);

glHint(GL_PERSPECTIVE_CORRECTION_HINT, GL_NICEST); //Realy Nice perspective calculations

glEnable(GL_TEXTURE_2D); // Enable Texture Mapping
LoadTexture('chrome.bmp', EnviroMapTex); // Load the Texture
glBindTexture(GL_TEXTURE_2D, EnviroMapTex); // Bind the Texture to the object

glTexGenf(GL_S, GL_TEXTURE_GEN_MODE, GL_SPHERE_MAP);
glTexGenf(GL_T, GL_TEXTURE_GEN_MODE, GL_SPHERE_MAP);

CreateFaceDisplayList;
CreateRenderTexture;

FaceCount :=50;
end;


{------------------------------------------------------------------}
{ Handle window resize }
{------------------------------------------------------------------}
procedure glResizeWnd(Width, Height : Integer);
begin
if (Height = 0) then // prevent divide by zero exception
Height := 1;
glViewport(0, 0, Width, Height); // Set the viewport for the OpenGL window
glMatrixMode(GL_PROJECTION); // Change Matrix Mode to Projection
glLoadIdentity(); // Reset View
gluPerspective(45.0, Width/Height, 0.1, 100.0); // Do the perspective calculations. Last value = max clipping depth

glMatrixMode(GL_MODELVIEW); // Return to the modelview matrix
glLoadIdentity(); // Reset View
end;


{------------------------------------------------------------------}
{ Processes all the keystrokes }
{------------------------------------------------------------------}
procedure ProcessKeys;
begin
// Add more faces
if Keys[VK_ADD] then
begin
Inc(FaceCount);
Keys[VK_ADD] :=FALSE;
end;

// remove faces
if Keys[VK_SUBTRACT] then
begin
if FaceCount > 0 then
Dec(FaceCount);
Keys[VK_SUBTRACT] :=FALSE;
end;
end;


{------------------------------------------------------------------}
{ Determines the application抯 response to the messages received }
{------------------------------------------------------------------}
function WndProc(hWnd: HWND; Msg: UINT; wParam: WPARAM; lParam: LPARAM): LRESULT; stdcall;
begin
case (Msg) of
WM_CREATE:
begin
// Insert stuff you want executed when the program starts
end;
WM_CLOSE:
begin
PostQuitMessage(0);
Result := 0
end;
WM_KEYDOWN: // Set the pressed key (wparam) to equal true so we can check if its pressed
begin
keys[wParam] := True;
Result := 0;
end;
WM_KEYUP: // Set the released key (wparam) to equal false so we can check if its pressed
begin
keys[wParam] := False;
Result := 0;
end;
WM_SIZE: // Resize the window with the new width and height
begin
glResizeWnd(LOWORD(lParam),HIWORD(lParam));
Result := 0;
end;
WM_TIMER : // Add code here for all timers to be used.
begin
if wParam = FPS_TIMER then
begin
FPSCount :=Round(FPSCount * 1000/FPS_INTERVAL); // calculate to get per Second incase intercal is less or greater than 1 second
SetWindowText(h_Wnd, PChar(WND_TITLE + ' [' + intToStr(FPSCount) + ' FPS] Faces=' + intToStr(FaceCount)));
FPSCount := 0;
Result := 0;
end;
end;
else
Result := DefWindowProc(hWnd, Msg, wParam, lParam); // Default result if nothing happens
end;
end;


{---------------------------------------------------------------------}
{ Properly destroys the window created at startup (no memory leaks) }
{---------------------------------------------------------------------}
procedure glKillWnd(Fullscreen : Boolean);
begin
if Fullscreen then // Change back to non fullscreen
begin
ChangeDisplaySettings(devmode(nil^), 0);
ShowCursor(True);
end;

// Makes current rendering context not current, and releases the device
// context that is used by the rendering context.
if (not wglMakeCurrent(h_DC, 0)) then
MessageBox(0, 'Release of DC and RC failed!', 'Error', MB_OK or MB_ICONERROR);

// Attempts to delete the rendering context
if (not wglDeleteContext(h_RC)) then
begin
MessageBox(0, 'Release of rendering context failed!', 'Error', MB_OK or MB_ICONERROR);
h_RC := 0;
end;

// Attemps to release the device context
if ((h_DC = 1) and (ReleaseDC(h_Wnd, h_DC) <> 0)) then
begin
MessageBox(0, 'Release of device context failed!', 'Error', MB_OK or MB_ICONERROR);
h_DC := 0;
end;

// Attempts to destroy the window
if ((h_Wnd <> 0) and (not DestroyWindow(h_Wnd))) then
begin
MessageBox(0, 'Unable to destroy window!', 'Error', MB_OK or MB_ICONERROR);
h_Wnd := 0;
end;

// Attempts to unregister the window class
if (not UnRegisterClass('OpenGL', hInstance)) then
begin
MessageBox(0, 'Unable to unregister window class!', 'Error', MB_OK or MB_ICONERROR);
hInstance := 0;
end;
end;


{--------------------------------------------------------------------}
{ Creates the window and attaches a OpenGL rendering context to it }
{--------------------------------------------------------------------}
function glCreateWnd(Width, Height : Integer; Fullscreen : Boolean; PixelDepth : Integer) : Boolean;
var
wndClass : TWndClass; // Window class
dwStyle : DWORD; // Window styles
dwExStyle : DWORD; // Extended window styles
dmScreenSettings : DEVMODE; // Screen settings (fullscreen, etc...)
PixelFormat : GLuint; // Settings for the OpenGL rendering
h_Instance : HINST; // Current instance
pfd : TPIXELFORMATDESCRIPTOR; // Settings for the OpenGL window
begin
h_Instance := GetModuleHandle(nil); //Grab An Instance For Our Window
ZeroMemory(@wndClass, SizeOf(wndClass)); // Clear the window class structure

with wndClass do // Set up the window class
begin
style := CS_HREDRAW or // Redraws entire window if length changes
CS_VREDRAW or // Redraws entire window if height changes
CS_OWNDC; // Unique device context for the window
lpfnWndProc := @WndProc; // Set the window procedure to our func WndProc
hInstance := h_Instance;
hCursor := LoadCursor(0, IDC_ARROW);
lpszClassName := 'OpenGL';
end;

if (RegisterClass(wndClass) = 0) then // Attemp to register the window class
begin
MessageBox(0, 'Failed to register the window class!', 'Error', MB_OK or MB_ICONERROR);
Result := False;
Exit
end;

// Change to fullscreen if so desired
if Fullscreen then
begin
ZeroMemory(@dmScreenSettings, SizeOf(dmScreenSettings));
with dmScreenSettings do begin // Set parameters for the screen setting
dmSize := SizeOf(dmScreenSettings);
dmPelsWidth := Width; // Window width
dmPelsHeight := Height; // Window height
dmBitsPerPel := PixelDepth; // Window color depth
dmFields := DM_PELSWIDTH or DM_PELSHEIGHT or DM_BITSPERPEL;
end;

// Try to change screen mode to fullscreen
if (ChangeDisplaySettings(dmScreenSettings, CDS_FULLSCREEN) = DISP_CHANGE_FAILED) then
begin
MessageBox(0, 'Unable to switch to fullscreen!', 'Error', MB_OK or MB_ICONERROR);
Fullscreen := False;
end;
end;

// If we are still in fullscreen then
if (Fullscreen) then
begin
dwStyle := WS_POPUP or // Creates a popup window
WS_CLIPCHILDREN // Doesn't draw within child windows
or WS_CLIPSIBLINGS; // Doesn't draw within sibling windows
dwExStyle := WS_EX_APPWINDOW; // Top level window
ShowCursor(False); // Turn of the cursor (gets in the way)
end
else
begin
dwStyle := WS_OVERLAPPEDWINDOW or // Creates an overlapping window
WS_CLIPCHILDREN or // Doesn't draw within child windows
WS_CLIPSIBLINGS; // Doesn't draw within sibling windows
dwExStyle := WS_EX_APPWINDOW or // Top level window
WS_EX_WINDOWEDGE; // Border with a raised edge
end;

// Attempt to create the actual window
h_Wnd := CreateWindowEx(dwExStyle, // Extended window styles
'OpenGL', // Class name
WND_TITLE, // Window title (caption)
dwStyle, // Window styles
0, 0, // Window position
Width, Height, // Size of window
0, // No parent window
0, // No menu
h_Instance, // Instance
nil); // Pass nothing to WM_CREATE
if h_Wnd = 0 then
begin
glKillWnd(Fullscreen); // Undo all the settings we've changed
MessageBox(0, 'Unable to create window!', 'Error', MB_OK or MB_ICONERROR);
Result := False;
Exit;
end;

// Try to get a device context
h_DC := GetDC(h_Wnd);
if (h_DC = 0) then
begin
glKillWnd(Fullscreen);
MessageBox(0, 'Unable to get a device context!', 'Error', MB_OK or MB_ICONERROR);
Result := False;
Exit;
end;

// Settings for the OpenGL window
with pfd do
begin
nSize := SizeOf(TPIXELFORMATDESCRIPTOR); // Size Of This Pixel Format Descriptor
nVersion := 1; // The version of this data structure
dwFlags := PFD_DRAW_TO_WINDOW // Buffer supports drawing to window
or PFD_SUPPORT_OPENGL // Buffer supports OpenGL drawing
or PFD_DOUBLEBUFFER; // Supports double buffering
iPixelType := PFD_TYPE_RGBA; // RGBA color format
cColorBits := PixelDepth; // OpenGL color depth
cRedBits := 0; // Number of red bitplanes
cRedShift := 0; // Shift count for red bitplanes
cGreenBits := 0; // Number of green bitplanes
cGreenShift := 0; // Shift count for green bitplanes
cBlueBits := 0; // Number of blue bitplanes
cBlueShift := 0; // Shift count for blue bitplanes
cAlphaBits := 0; // Not supported
cAlphaShift := 0; // Not supported
cAccumBits := 0; // No accumulation buffer
cAccumRedBits := 0; // Number of red bits in a-buffer
cAccumGreenBits := 0; // Number of green bits in a-buffer
cAccumBlueBits := 0; // Number of blue bits in a-buffer
cAccumAlphaBits := 0; // Number of alpha bits in a-buffer
cDepthBits := 16; // Specifies the depth of the depth buffer
cStencilBits := 0; // Turn off stencil buffer
cAuxBuffers := 0; // Not supported
iLayerType := PFD_MAIN_PLANE; // Ignored
bReserved := 0; // Number of overlay and underlay planes
dwLayerMask := 0; // Ignored
dwVisibleMask := 0; // Transparent color of underlay plane
dwDamageMask := 0; // Ignored
end;

// Attempts to find the pixel format supported by a device context that is the best match to a given pixel format specification.
PixelFormat := ChoosePixelFormat(h_DC, @pfd);
if (PixelFormat = 0) then
begin
glKillWnd(Fullscreen);
MessageBox(0, 'Unable to find a suitable pixel format', 'Error', MB_OK or MB_ICONERROR);
Result := False;
Exit;
end;

// Sets the specified device context's pixel format to the format specified by the PixelFormat.
if (not SetPixelFormat(h_DC, PixelFormat, @pfd)) then
begin
glKillWnd(Fullscreen);
MessageBox(0, 'Unable to set the pixel format', 'Error', MB_OK or MB_ICONERROR);
Result := False;
Exit;
end;

// Create a OpenGL rendering context
h_RC := wglCreateContext(h_DC);
if (h_RC = 0) then
begin
glKillWnd(Fullscreen);
MessageBox(0, 'Unable to create an OpenGL rendering context', 'Error', MB_OK or MB_ICONERROR);
Result := False;
Exit;
end;

// Makes the specified OpenGL rendering context the calling thread's current rendering context
if (not wglMakeCurrent(h_DC, h_RC)) then
begin
glKillWnd(Fullscreen);
MessageBox(0, 'Unable to activate OpenGL rendering context', 'Error', MB_OK or MB_ICONERROR);
Result := False;
Exit;
end;

// Initializes the timer used to calculate the FPS
SetTimer(h_Wnd, FPS_TIMER, FPS_INTERVAL, nil);

// Settings to ensure that the window is the topmost window
ShowWindow(h_Wnd, SW_SHOW);
SetForegroundWindow(h_Wnd);
SetFocus(h_Wnd);

// Ensure the OpenGL window is resized properly
glResizeWnd(Width, Height);
glInit();

Result := True;
end;


{--------------------------------------------------------------------}
{ Main message loop for the application }
{--------------------------------------------------------------------}
function WinMain(hInstance : HINST; hPrevInstance : HINST;
lpCmdLine : PChar; nCmdShow : Integer) : Integer; stdcall;
var
msg : TMsg;
finished : Boolean;
DemoStart, LastTime : DWord;
begin
finished := False;

// Perform application initialization:
if not glCreateWnd(800, 600, FALSE, 32) then
begin
Result := 0;
Exit;
end;

DemoStart := GetTickCount(); // Get Time when demo started

// Main message loop:
while not finished do
begin
if (PeekMessage(msg, 0, 0, 0, PM_REMOVE)) then // Check if there is a message for this window
begin
if (msg.message = WM_QUIT) then // If WM_QUIT message received then we are done
finished := True
else
begin // Else translate and dispatch the message to this window
TranslateMessage(msg);
DispatchMessage(msg);
end;
end
else
begin
Inc(FPSCount); // Increment FPS Counter

LastTime :=ElapsedTime;
ElapsedTime :=GetTickCount() - DemoStart; // Calculate Elapsed Time
ElapsedTime :=(LastTime + ElapsedTime) DIV 2; // Average it out for smoother movement

glDraw(); // Draw the scene
SwapBuffers(h_DC); // Display the scene

if (keys[VK_ESCAPE]) then // If user pressed ESC then set finised TRUE
finished := True
else
ProcessKeys; // Check for any other key Pressed
end;
end;
glKillWnd(FALSE);
Result := msg.wParam;
end;


begin
WinMain( hInstance, hPrevInst, CmdLine, CmdShow );
end.
 
to cdyxl
上次给你的分是很少,我很报歉。不过上次分本来很少,而且我给你@hotmail.com
发了封信。希望你能和我联系。可是也没有收到你的回信。我还在在线富翁里找过
你,不过没有找到。我再开一个问题给你补上分好吗!
 
to huasoft
我正在学习你的程序。你的网站很漂亮!!
 
to huasoft
我按你给我的程序编,怎么运行不了呢?
错误是:
chromeface.exe faulted with message:'access violation at 0x00184252'
 
呵呵!我又来了!看看这次有没有收获!哈哈!
 
问题可能出在
use opengl
若有opengl12.pas文件,把它改成
use opengl12
 
多人接受答案了。
 
后退
顶部