|
|
1.1 ! root 1: /*--------------------------------------------------------*\ ! 2: SDATA.C - object definitions, initialization data ! 3: and table of shapes ! 4: \*--------------------------------------------------------*/ ! 5: ! 6: #include <stddef.h> ! 7: #include <os2.h> ! 8: #include "sstruct.h" ! 9: ! 10: ! 11: /*--------------------------------------------------------*\ ! 12: Object Definitions ! 13: \*--------------------------------------------------------*/ ! 14: ! 15: POINT3D rgpt3Cube [] = ! 16: { { 10, 10, 10}, {-10, 10, 10}, {-10,-10, 10}, { 10,-10, 10}, ! 17: { 10, 10,-10}, {-10, 10,-10}, {-10,-10,-10}, { 10,-10,-10} }; ! 18: LINE rglineCube [] = ! 19: { {0,1}, {1,2}, {2,3}, {3,0}, ! 20: {0,4}, {1,5}, {2,6}, {3,7}, ! 21: {7,4}, {4,5}, {5,6}, {6,7}, {-1,-1} }; ! 22: FACE rgfaceCube [] = ! 23: { 0,1,2,3,-2, ! 24: 0,3,7,4,-2, ! 25: 3,2,6,7,-2, ! 26: 7,6,5,4,-2, ! 27: 2,1,5,6,-2, ! 28: 4,5,1,0,-2, ! 29: -3 }; ! 30: OBJECT objectCube = ! 31: { 8, rgpt3Cube, rglineCube, rgfaceCube }; ! 32: ! 33: POINT3D rgpt3Pyramid [] = ! 34: { { 10,-10, 10}, {-10,-10, 10}, {-10,-10,-10}, { 10,-10,-10}, ! 35: { 0, 10, 0} }; ! 36: LINE rglinePyramid [] = ! 37: { {0,1}, {1,2}, {2,3}, {3,0}, ! 38: {0,4}, {4,1}, {2,4}, {4,3}, {-1,-1} }; ! 39: FACE rgfacePyramid [] = ! 40: { 0,1,2,3,-2, ! 41: 4,0,3,-2, ! 42: 4,3,2,-2, ! 43: 4,2,1,-2, ! 44: 4,1,0,-2, ! 45: -3 }; ! 46: OBJECT objectPyramid = ! 47: { 5, rgpt3Pyramid, rglinePyramid, rgfacePyramid }; ! 48: ! 49: POINT3D rgpt3Cage [] = ! 50: { { 10, 5, 15}, { 5, 10, 15}, { -5, 10, 15}, {-10, 5, 15}, ! 51: {-10, -5, 15}, { -5,-10, 15}, { 5,-10, 15}, { 10, -5, 15}, ! 52: { 10, 5,-15}, { 5, 10,-15}, { -5, 10,-15}, {-10, 5,-15}, ! 53: {-10, -5,-15}, { -5,-10,-15}, { 5,-10,-15}, { 10, -5,-15} }; ! 54: LINE rglineCage [] = ! 55: { { 0, 1}, { 1, 2}, { 2, 3}, { 3, 4}, ! 56: { 4, 5}, { 5, 6}, { 6, 7}, { 7, 0}, { 0, 8}, ! 57: { 8, 9}, { 9,10}, {10,11}, {11,12}, ! 58: {12,13}, {13,14}, {14,15}, {15, 8}, ! 59: { 1, 9}, { 2,10}, { 3,11}, { 4,12}, ! 60: { 5,13}, { 6,14}, { 7,15}, {-1,-1} }; ! 61: FACE rgfaceCage [] = ! 62: { 0,1,2,3,4,5,6,7,-2, ! 63: 15,14,13,12,11,10,9,8,-2, ! 64: 1,0,8,9,-2, ! 65: 2,1,9,10,-2, ! 66: 3,2,10,11,-2, ! 67: 4,3,11,12,-2, ! 68: 5,4,12,13,-2, ! 69: 6,5,13,14,-2, ! 70: 7,6,14,15,-2, ! 71: 0,7,15,8,-2, ! 72: -3 }; ! 73: OBJECT objectCage = ! 74: { 16, rgpt3Cage, rglineCage, rgfaceCage }; ! 75: ! 76: POINT3D rgpt3Charlie [] = ! 77: { { 15, 5, 5}, { 5, 15, 5}, { -5, 15, 5}, {-15, 5, 5}, ! 78: {-15, -5, 5}, { -5,-15, 5}, { 5,-15, 5}, { 15, -5, 5}, ! 79: { 15, 5, -5}, { 5, 15, -5}, { -5, 15, -5}, {-15, 5, -5}, ! 80: {-15, -5, -5}, { -5,-15, -5}, { 5,-15, -5}, { 15, -5, -5}, ! 81: { 5, 5, 15}, { -5, 5, 15}, { -5, -5, 15}, { 5, -5, 15}, ! 82: { 5, 5,-15}, { -5, 5,-15}, { -5, -5,-15}, { 5, -5,-15} }; ! 83: FACE rgfaceCharlie [] = ! 84: { 1,0,8,9,-2, ! 85: 2,1,9,10,-2, ! 86: 3,2,10,11,-2, ! 87: 4,3,11,12,-2, ! 88: 5,4,12,13,-2, ! 89: 6,5,13,14,-2, ! 90: 7,6,14,15,-2, ! 91: 0,7,15,8,-2, ! 92: 0,16,19,7,-2, ! 93: 1,16,0,-2, ! 94: 2,17,16,1,-2, ! 95: 3,17,2,-2, ! 96: 4,18,17,3,-2, ! 97: 5,18,4,-2, ! 98: 6,19,18,5,-2, ! 99: 7,19,6,-2, ! 100: 20,8,15,23,-2, ! 101: 20,9,8,-2, ! 102: 21,10,9,20,-2, ! 103: 21,11,10,-2, ! 104: 22,12,11,21,-2, ! 105: 22,13,12,-2, ! 106: 23,14,13,22,-2, ! 107: 23,15,14,-2, ! 108: 16,17,18,19,-2, ! 109: 23,22,21,20,-2, ! 110: -3 }; ! 111: OBJECT objectCharlie = ! 112: { 24, rgpt3Charlie, NULL, rgfaceCharlie }; ! 113: ! 114: POINT3D rgpt3Dodeca [] = ! 115: {{ 85, 0,112}, { 26, 81,112}, {-69, 50,112}, {-69,-50,112}, { 26,-81,112}, ! 116: {138, 0, 27}, { 43,131, 27}, {-111, 81, 27},{-111,-81, 27},{ 43,-131, 27}, ! 117: {-138, 0,-27}, {-43,-131,-27},{ 111,-81,-27},{ 111, 81,-27},{-43, 131,-27}, ! 118: {-85, 0,-112},{-26,-81,-112},{ 69,-50,-112},{ 69, 50,-112},{-26, 81,-112} ! 119: }; ! 120: LINE rglineDodeca [] = ! 121: { {0,1}, {1,2}, {2,3}, {3,4}, {4,0}, ! 122: {0,5}, {5,13}, {13,6}, {6,1}, ! 123: {6,14}, {14,7}, {7,2}, ! 124: {7,10}, {10,8}, {8,3}, ! 125: {8,11}, {11,9}, {9,4}, ! 126: {9,12}, {12,5}, ! 127: {10,15}, {15,16}, {16,11}, ! 128: {16,17}, {17,12}, ! 129: {17,18}, {18,13}, ! 130: {18,19}, {19,14}, ! 131: {19,15}, ! 132: {-1,-1} }; ! 133: FACE rgfaceDodeca [] = ! 134: { 0,1,2,3,4,-2, ! 135: 0,5,13,6,1,-2, ! 136: 1,6,14,7,2,-2, ! 137: 2,7,10,8,3,-2, ! 138: 3,8,11,9,4,-2, ! 139: 4,9,12,5,0,-2, ! 140: 10,15,16,11,8,-2, ! 141: 11,16,17,12,9,-2, ! 142: 12,17,18,13,5,-2, ! 143: 13,18,19,14,6,-2, ! 144: 14,19,15,10,7,-2, ! 145: 19,18,17,16,15,-2, ! 146: -3 }; ! 147: OBJECT objectDodeca = ! 148: { 20, rgpt3Dodeca, rglineDodeca, rgfaceDodeca }; ! 149: ! 150: POINT3D rgpt3Icosa [] = ! 151: { {0,0,112}, {80,58,50}, {-30,94,50}, {-99,0,50}, ! 152: {-30,-94,50}, {80,-58,50}, {-80,-58,-50}, {30,-94,-50}, ! 153: {99,0,-50}, {30,94,-50}, {-80,58,-50}, {0,0,-112} ! 154: }; ! 155: LINE rglineIcosa [] = ! 156: { {1,0}, {0,2}, {2,1}, {0,3}, {3,2}, ! 157: {0,4}, {4,3}, {0,5}, {5,1}, {5,4}, ! 158: {3,6}, {6,4}, {4,7}, {7,5}, {7,6}, ! 159: {1,8}, {8,5}, {8,7}, {1,9}, {9,2}, ! 160: {9,8}, {2,10}, {10,3}, {6,10}, {10,9}, ! 161: {6,11}, {11,7}, {8,11}, {11,9}, {11,10}, ! 162: {-1,-1} }; ! 163: FACE rgfaceIcosa [] = ! 164: { 0,1,2,-2, ! 165: 0,2,3,-2, ! 166: 0,3,4,-2, ! 167: 0,4,5,-2, ! 168: 0,5,1,-2, ! 169: 11,10,9,-2, ! 170: 11,9,8,-2, ! 171: 11,8,7,-2, ! 172: 11,7,6,-2, ! 173: 11,6,10,-2, ! 174: 1,8,9,-2, ! 175: 2,1,9,-2, ! 176: 2,9,10,-2, ! 177: 3,2,10,-2, ! 178: 3,10,6,-2, ! 179: 4,3,6,-2, ! 180: 4,6,7,-2, ! 181: 5,4,7,-2, ! 182: 5,7,8,-2, ! 183: 1,5,8,-2, ! 184: -3 }; ! 185: OBJECT objectIcosa = ! 186: { 12, rgpt3Icosa, rglineIcosa, rgfaceIcosa }; ! 187: ! 188: POINT3D rgpt3Micro [] = ! 189: { {-12,-2,0}, {-12, 2,0}, {-11, 0,0}, {-10, 2,0}, {-10,-2,0}, ! 190: { -9,-2,0}, { -9, 2,0}, ! 191: { -6,-1,0}, { -7,-2,0}, { -8,-1,0}, { -8, 1,0}, { -7, 2,0}, { -6, 1,0}, ! 192: { -5,-2,0}, { -5, 2,0}, { -4, 2,0}, { -3, 1,0}, { -4, 0,0}, { -5, 0,0}, ! 193: { -3,-2,0}, ! 194: { -1,-2,0}, { -2,-1,0}, { -2, 1,0}, { -1, 2,0}, { 0, 1,0}, { 0,-1,0}, ! 195: { 1,-1,0}, { 2,-2,0}, { 3,-1,0}, { 1, 1,0}, { 2, 2,0}, { 3, 1,0}, ! 196: { 5,-2,0}, { 4,-1,0}, { 4, 1,0}, { 5, 2,0}, { 6, 1,0}, { 6,-1,0}, ! 197: { 7,-2,0}, { 7, 2,0}, { 9, 2,0}, { 7, 0,0}, { 9, 0,0}, ! 198: { 10, 2,0}, { 12, 2,0}, { 11, 2,0}, { 11,-2,0}, ! 199: {-13,-3,0}, {-13, 3,0}, { 13, 3,0}, { 13,-3,0} ! 200: }; ! 201: LINE rglineMicro [] = ! 202: { {47,48}, {48,49}, {49,50}, {50,47}, ! 203: { 0, 1}, { 1, 2}, { 2, 3}, {3 , 4}, ! 204: { 5, 6}, ! 205: { 7, 8}, { 8, 9}, { 9,10}, {10,11}, {11,12}, ! 206: {13,14}, {14,15}, {15,16}, {16,17}, {17,18}, {17,19}, ! 207: {20,21}, {21,22}, {22,23}, {23,24}, {24,25}, {25,20}, ! 208: {26,27}, {27,28}, {28,29}, {29,30}, {30,31}, ! 209: {32,33}, {33,34}, {34,35}, {35,36}, {36,37}, {37,32}, ! 210: {38,39}, {39,40}, {41,42}, ! 211: {43,44}, {45,46}, ! 212: {-1,-1} }; ! 213: FACE rgfaceMicro [] = ! 214: { 47,48,49,50,-2, ! 215: 50,49,48,47,-1, ! 216: 0,1,2,3,4,-1, ! 217: 5,6,-1, ! 218: 7,8,9,10,11,12,-1, ! 219: 13,14,15,16,17,18,-1, 17,19,-1, ! 220: 20,21,22,23,24,25,20,-1, ! 221: 26,27,28,29,30,31,-1, ! 222: 32,33,34,35,36,37,32,-1, ! 223: 38,39,40,-1, 41,42,-1, ! 224: 43,44,-1, 45,46,-2, ! 225: -3 }; ! 226: OBJECT objectMicro = ! 227: { 51, rgpt3Micro, rglineMicro, rgfaceMicro }; ! 228: ! 229: POINT3D rgpt3Die [] = ! 230: { { 10, 10, 10}, {-10, 10, 10}, {-10,-10, 10}, { 10,-10, 10}, ! 231: { 10, 10,-10}, {-10, 10,-10}, {-10,-10,-10}, { 10,-10,-10}, ! 232: { 0, 6, 10}, { 0, -6, 10}, ! 233: {-10, 4, 3}, {-10, 0, 6}, {-10, -4, 3}, {-10, 4, -6}, ! 234: {-10, -4, -6}, ! 235: { 4, 10, 3}, { 0, 10, 6}, { -4, 10, 3}, { 0, 10, 0}, ! 236: { -4, 10, -3}, { 0, 10, -6}, { 4, 10, -3}, ! 237: { -4,-10, 6}, { -4,-10, 0}, { 4,-10, 0}, { 4,-10, 6}, ! 238: { 4,-10, -6}, ! 239: { 10, 4, 6}, { 10, -4, 6}, { 10, -4, 2}, { 10, 0, 2}, ! 240: { 10, 4, -2}, { 10, 0, -6}, { 10, -4, -3}, ! 241: { 0, 6,-10}, { 4, 3,-10}, { 4, -3,-10}, { 0, -6,-10}, ! 242: { -4, -3,-10}, { 0, 0,-10} }; ! 243: LINE rglineDie [] = ! 244: { {0,1}, {1,2}, {2,3}, {3,0}, {8,9}, ! 245: {0,3}, {3,7}, {7,4}, {4,0}, {27,28}, {28,29}, {29,30}, {30,31}, ! 246: {31,32}, {32,33}, ! 247: {3,2}, {2,6}, {6,7}, {7,3}, {22,23}, {23,24}, {25,26}, ! 248: {7,6}, {6,5}, {5,4}, {4,7}, {34,35}, {35,36}, {36,37}, {37,38}, ! 249: {38,39}, {39,36}, ! 250: {2,1}, {1,5}, {5,6}, {6,2}, {10,11}, {11,12}, {12,13}, {13,14}, ! 251: {4,5}, {5,1}, {1,0}, {0,4}, {15,16}, {16,17}, {17,18}, {18,19}, ! 252: {19,20}, {20,21}, ! 253: {-1,-1} }; ! 254: FACE rgfaceDie [] = ! 255: { 0,1,2,3,-1, 8,9, -2, ! 256: 0,3,7,4,-1, 27,28,29,30,31,32,33, -2, ! 257: 3,2,6,7,-1, 22,23,24,-1, 25,26, -2, ! 258: 7,6,5,4,-1, 34,35,36,37,38,39,36, -2, ! 259: 2,1,5,6,-1, 10,11,12,13,14, -2, ! 260: 4,5,1,0,-1, 15,16,17,18,19,20,21, -2, ! 261: -3 }; ! 262: OBJECT objectDie = ! 263: { 40, rgpt3Die, rglineDie, rgfaceDie }; ! 264: ! 265: POINT3D rgpt3Diamond [] = ! 266: { { 16, 0, 10}, { 14, 8, 10}, { 8, 14, 10}, ! 267: { 0, 16, 10}, { -8, 14, 10}, {-14, 8, 10}, ! 268: {-16, 0, 10}, {-14, -8, 10}, { -8,-14, 10}, ! 269: { 0,-16, 10}, { 8,-14, 10}, { 14, -8, 10}, ! 270: { 20, 0, 3}, { 17, 10, 3}, { 10, 17, 3}, ! 271: { 0, 20, 3}, {-10, 17, 3}, {-17, 10, 3}, ! 272: {-20, 0, 3}, {-17,-10, 3}, {-10,-17, 3}, ! 273: { 0,-20, 3}, { 10,-17, 3}, { 17,-10, 3}, ! 274: { 0, 0,-20} }; ! 275: FACE rgfaceDiamond [] = ! 276: { 0,1,2,3,4,5,6,7,8,9,10,11,-2, ! 277: 1,0,12,13,-2, ! 278: 2,1,13,14,-2, ! 279: 3,2,14,15,-2, ! 280: 4,3,15,16,-2, ! 281: 5,4,16,17,-2, ! 282: 6,5,17,18,-2, ! 283: 7,6,18,19,-2, ! 284: 8,7,19,20,-2, ! 285: 9,8,20,21,-2, ! 286: 10,9,21,22,-2, ! 287: 11,10,22,23,-2, ! 288: 0,11,23,12,-2, ! 289: 24,13,12,-2, ! 290: 24,14,13,-2, ! 291: 24,15,14,-2, ! 292: 24,16,15,-2, ! 293: 24,17,16,-2, ! 294: 24,18,17,-2, ! 295: 24,19,18,-2, ! 296: 24,20,19,-2, ! 297: 24,21,20,-2, ! 298: 24,22,21,-2, ! 299: 24,23,22,-2, ! 300: 24,12,23,-2, ! 301: -3 }; ! 302: OBJECT objectDiamond = ! 303: { 25, rgpt3Diamond, NULL, rgfaceDiamond }; ! 304: ! 305: POINT3D rgpt3Disc [] = ! 306: { { 20, 0, 0}, { 14, 14, 0}, { 0, 20, 0}, {-14, 14, 0}, ! 307: {-20, 0, 0}, {-14,-14, 0}, { 0,-20, 0}, { 14,-14, 0}, ! 308: { 0, 0, 8}, { 0, 0,-8} }; ! 309: FACE rgfaceDisc [] = ! 310: { 0,1,8,-2, ! 311: 1,2,8,-2, ! 312: 2,3,8,-2, ! 313: 3,4,8,-2, ! 314: 4,5,8,-2, ! 315: 5,6,8,-2, ! 316: 6,7,8,-2, ! 317: 7,0,8,-2, ! 318: 1,0,9,-2, ! 319: 2,1,9,-2, ! 320: 3,2,9,-2, ! 321: 4,3,9,-2, ! 322: 5,4,9,-2, ! 323: 6,5,9,-2, ! 324: 7,6,9,-2, ! 325: 0,7,9,-2, ! 326: -3 }; ! 327: OBJECT objectDisc = ! 328: { 10, rgpt3Disc, NULL, rgfaceDisc }; ! 329: ! 330: ! 331: /*--------------------------------------------------------*\ ! 332: Initialization Data ! 333: \*--------------------------------------------------------*/ ! 334: ! 335: INIT initDefault = ! 336: { 1000, /* view distance */ ! 337: { 0, 0, 0 }, /* initial angle */ ! 338: { 2, 2, 2 }, /* angular velocity */ ! 339: { 700, 700, 700 }, /* size factor */ ! 340: { 200, 200, 200 }, /* size variation */ ! 341: { 0, 0, 0 }, /* size variation initial angle */ ! 342: { 5, 5, 5 } /* size variation angular velocity */ ! 343: }; ! 344: ! 345: INIT initStretch = ! 346: { 1500, /* view distance */ ! 347: { 0, 0, 0 }, /* initial angle */ ! 348: { 1, 1, 0 }, /* angular velocity */ ! 349: { 500, 700, 900 }, /* size factor */ ! 350: { 350, 250, 150 }, /* size variation */ ! 351: { 0, 120, 240 }, /* size variation initial angle */ ! 352: { 7, 7, 7 } /* size variation angular velocity */ ! 353: }; ! 354: ! 355: INIT initDodeca = ! 356: { 1500, /* view distance */ ! 357: { 0, 30, 0 }, /* initial angle */ ! 358: { 1, 0, 1 }, /* angular velocity */ ! 359: { 90, 90, 90 }, /* size factor */ ! 360: { 20, 20, 20 }, /* size variation */ ! 361: { 0, 0, 0 }, /* size variation initial angle */ ! 362: { 5, 5, 5 } /* size variation angular velocity */ ! 363: }; ! 364: ! 365: INIT initIcosa = ! 366: { 1500, /* view distance */ ! 367: { 0, 30, 0 }, /* initial angle */ ! 368: { 1, 0, 1 }, /* angular velocity */ ! 369: { 130, 130, 130 }, /* size factor */ ! 370: { 30, 30, 30 }, /* size variation */ ! 371: { 0, 0, 0 }, /* size variation initial angle */ ! 372: { 5, 5, 5 } /* size variation angular velocity */ ! 373: }; ! 374: ! 375: INIT initMicro = ! 376: { 1000, /* view distance */ ! 377: { 0, 0, 0 }, /* initial angle */ ! 378: { 5, 0, 0 }, /* angular velocity */ ! 379: {1300,2800, 0 }, /* size factor */ ! 380: { 300, 300, 0 }, /* size variation */ ! 381: { 0, 180, 0 }, /* size variation initial angle */ ! 382: { 5, 5, 0 } /* size variation angular velocity */ ! 383: }; ! 384: ! 385: INIT initSpinning = ! 386: { 1000, /* view distance */ ! 387: { 290, 0, 0 }, /* initial angle */ ! 388: { 0, 4, 0 }, /* angular velocity */ ! 389: { 550, 550, 550 }, /* size factor */ ! 390: { 150, 150, 150 }, /* size variation */ ! 391: { 0, 0, 0 }, /* size variation initial angle */ ! 392: { 5, 5, 5 } /* size variation angular velocity */ ! 393: }; ! 394: ! 395: ! 396: /*--------------------------------------------------------*\ ! 397: Main table of shapes ! 398: \*--------------------------------------------------------*/ ! 399: ! 400: extern SHAPE rgshape [] = ! 401: { { "Cube", &objectCube, &initStretch }, ! 402: { "Charlie", &objectCharlie, &initDefault }, ! 403: { "Cage", &objectCage, &initSpinning }, ! 404: { "Dodecahedron", &objectDodeca, &initDodeca }, ! 405: { "Disc", &objectDisc, &initSpinning }, ! 406: { "Die", &objectDie, &initDefault }, ! 407: { "Diamond", &objectDiamond, &initSpinning }, ! 408: { "Icosahedron", &objectIcosa, &initIcosa }, ! 409: { "Microsoft", &objectMicro, &initMicro }, ! 410: { "Pyramid", &objectPyramid, &initDefault }, ! 411: { "Susan", &objectCharlie, &initStretch } ! 412: }; ! 413: ! 414: /* number of shapes in table */ ! 415: ! 416: extern INT shapeMax = (sizeof rgshape / sizeof (SHAPE));
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.