XML Feeds

.

[jitter] Rubix Cube Positions

Michael Giambrone xphacter at gmail.com
Wed Jan 2 11:16:41 MST 2008


im making a 2x2x2 rubix cube, which is 8 cubes, with only 3 visible sides each, i made my engine work so each cube has 8 different positions, and they move using shape orient, however when a cube rotates within itself, it has totally different rotate properties.  so that means the cube has 3 states within each position making it 24 different combinations total for each cube, with 8 different cubes this makes the total number of states i have to handle is 192. Thats way too many states to handle, and in my opinion not efficient because i have to rewrite everything in order to upgrade to bigger cubes. my only solution i can think of is having each cube have three different location properties, and moving them as a different dynamic group.

Any Ideas?


max v2;
#N vpatcher 13 82 1571 1082;
#P origin 15 22;
#P window setfont "Sans Serif" 9.;
#P window linecount 2;
#P comment 891 244 100 196617 Hit this button to reset that cube;
#P window linecount 3;
#P comment 740 240 100 196617 Hit this button to rotate a single cube clockwise;
#P window linecount 2;
#P comment 589 255 100 196617 Hit this button to rotate clockwise;
#P window linecount 1;
#P message 913 287 14 196617 0;
#P message 774 281 20 196617 90;
#P newex 508 201 48 196617 loadbang;
#P message 176 100 70 196617 camera 8 8 8;
#P newex 499 255 54 196617 pack 0 90;
#P message 590 290 68 196617 \$2 \, \$1 1000;
#P message 366 295 68 196617 \$1 \, \$2 1000;
#P newex 495 451 40 196617 r stuff;
#P number 498 432 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P number 541 431 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P newex 515 470 57 196617 pack 0 0 0;
#P number 588 430 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P newex 262 449 40 196617 r stuff;
#P number 270 429 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P number 313 428 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P newex 287 467 57 196617 pack 0 0 0;
#P number 360 427 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P newex 17 450 40 196617 r stuff;
#P number 29 432 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P number 72 431 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P newex 46 470 57 196617 pack 0 0 0;
#P number 119 430 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P newex 758 461 40 196617 r stuff;
#P number 767 443 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P number 810 442 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P newex 784 481 57 196617 pack 0 0 0;
#P number 857 441 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P newex 724 612 40 196617 r stuff;
#P number 726 594 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P number 769 593 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P newex 743 632 57 196617 pack 0 0 0;
#P number 816 592 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P newex 490 603 40 196617 r stuff;
#P number 499 584 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P number 536 585 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P newex 516 622 57 196617 pack 0 0 0;
#P number 585 586 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P newex 258 603 40 196617 r stuff;
#P number 260 579 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P number 305 582 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P newex 279 621 57 196617 pack 0 0 0;
#P number 352 581 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P newex 40 585 40 196617 r stuff;
#P number 46 566 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P number 89 565 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P newex 63 604 57 196617 pack 0 0 0;
#P newex 499 340 50 196617 line 1 20;
#P message 747 659 225 196617 reset \, shapeorient \$1 \$2 \$3 \, drawobject cube4;
#P newex 745 685 105 196617 jit.gl.sketch mycube;
#P message 519 663 225 196617 reset \, shapeorient \$1 \$2 \$3 \, drawobject cube3;
#P newex 517 689 105 196617 jit.gl.sketch mycube;
#P message 279 658 225 196617 reset \, shapeorient \$1 \$2 \$3 \, drawobject cube2;
#P newex 277 684 105 196617 jit.gl.sketch mycube;
#P message 502 505 225 196617 reset \, shapeorient \$1 \$2 \$3 \, drawobject cube8;
#P newex 500 531 105 196617 jit.gl.sketch mycube;
#P number 136 564 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P message 25 643 225 196617 reset \, shapeorient \$1 \$2 \$3 \, drawobject cube1;
#P newex 29 675 105 196617 jit.gl.sketch mycube;
#P message 777 515 225 196617 reset \, shapeorient \$1 \$2 \$3 \, drawobject cube5;
#P newex 772 541 105 196617 jit.gl.sketch mycube;
#P message 34 503 225 196617 reset \, shapeorient \$1 \$2 \$3 \, drawobject cube6;
#P newex 30 529 105 196617 jit.gl.sketch mycube;
#P message 1287 1227 253 196617 reset \, drawobject w8 \, drawobject b8 \, drawobject o8;
#P newex 1286 1249 232 196617 jit.gl.sketch mycube @automatic 0 @name cube6;
#P message 1270 1179 253 196617 reset \, drawobject w7 \, drawobject g7 \, drawobject o7;
#P newex 1269 1201 232 196617 jit.gl.sketch mycube @automatic 0 @name cube8;
#P message 1262 1129 253 196617 reset \, drawobject w6 \, drawobject g6 \, drawobject r6;
#P newex 1261 1151 232 196617 jit.gl.sketch mycube @automatic 0 @name cube7;
#P message 1247 1077 253 196617 reset \, drawobject w5 \, drawobject b5 \, drawobject r5;
#P newex 1246 1099 232 196617 jit.gl.sketch mycube @automatic 0 @name cube5;
#P message 1025 1226 251 196617 reset \, drawobject y4 \, drawobject g4 \, drawobject o4;
#P newex 1024 1248 232 196617 jit.gl.sketch mycube @automatic 0 @name cube4;
#P message 1007 1178 251 196617 reset \, drawobject y3 \, drawobject g3 \, drawobject r3;
#P newex 1006 1200 232 196617 jit.gl.sketch mycube @automatic 0 @name cube3;
#P message 990 1130 251 196617 reset \, drawobject y2 \, drawobject b2 \, drawobject o2;
#P newex 990 1150 232 196617 jit.gl.sketch mycube @automatic 0 @name cube2;
#P message 274 505 225 196617 reset \, shapeorient \$1 \$2 \$3 \, drawobject cube7;
#P newex 272 531 105 196617 jit.gl.sketch mycube;
#P message 974 1079 251 196617 reset \, drawobject y1 \, drawobject b1 \, drawobject r1;
#P newex 973 1101 232 196617 jit.gl.sketch mycube @automatic 0 @name cube1;
#P newex 1145 980 48 196617 loadbang;
#P newex 365 75 38 196617 sel 27;
#P message 123 31 34 196617 reset;
#P newex 123 55 206 196617 jit.gl.handle mycube @inherit_transform 1;
#P message 364 116 70 196617 fullscreen \$1;
#P toggle 364 96 15 0;
#P newex 361 49 40 196617 key;
#P number 80 22 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P user jit.fpsgui 20 159 60 196617 0;
#P toggle 20 28 15 0;
#P newex 117 108 40 196617 s stuff;
#P newex 21 132 286 196617 jit.gl.render mycube @erase_color 0. 0. 0. 1. @camera 8 8 8;
#P newex 20 79 58 196617 t b b erase;
#P newex 20 54 57 196617 qmetro 33;
#P newex 364 137 225 196617 jit.window mycube @floating 1 @depthbuffer 1;
#P window linecount 2;
#P newex 372 1045 276 196617 jit.gl.gridshape mycube @shape plane @rotatexyz 0. 90. 0. @position -2 1 1 @color 1 0.5 0 1 @name o8 @automatic 0;
#B color 5;
#P newex 372 1010 281 196617 jit.gl.gridshape mycube @shape plane @rotatexyz 0. 90. 0. @position -2 -1 1 @color 1 0.5 0 1 @name o7 @automatic 0;
#B color 5;
#P newex 372 943 286 196617 jit.gl.gridshape mycube @shape plane @rotatexyz 0. 90. 0. @position -2 -1 -1 @color 1 0.5 0 1 @name o4 @automatic 0;
#B color 5;
#P newex 376 978 281 196617 jit.gl.gridshape mycube @shape plane @rotatexyz 0. 90. 0. @position -2 1 -1 @color 1 0.5 0 1 @name o2 @automatic 0;
#B color 5;
#P newex 1 1166 281 196617 jit.gl.gridshape mycube @shape plane @rotatexyz 0. 90. 0. @position 2 1 1 @color 1 0 0 1 @name r5 @automatic 0;
#B color 5;
#P newex 1 1236 281 196617 jit.gl.gridshape mycube @shape plane @rotatexyz 0. 90. 0. @position 2 -1 1 @color 1 0 0 1 @name r6 @automatic 0;
#B color 5;
#P newex 1 1202 272 196617 jit.gl.gridshape mycube @shape plane @rotatexyz 0. 90. 0. @position 2 -1 -1 @color 1 0 0 1 @name r3 @automatic 0;
#B color 5;
#P newex 2 1131 281 196617 jit.gl.gridshape mycube @shape plane @rotatexyz 0. 90. 0. @position 2 1 -1 @color 1 0 0 1 @name r1 @automatic 0;
#B color 5;
#P newex 721 951 234 196617 jit.gl.gridshape mycube @shape plane @position 1. -1 2 @color 1 1 1 1 @name w6 @automatic 0;
#B color 5;
#P newex 718 1014 239 196617 jit.gl.gridshape mycube @shape plane @position -1. -1 2 @color 1 1 1 1 @name w7 @automatic 0;
#B color 5;
#P newex 720 1046 234 196617 jit.gl.gridshape mycube @shape plane @position -1. 1 2 @color 1 1 1 1 @name w8 @automatic 0;
#B color 5;
#P newex 721 982 235 196617 jit.gl.gridshape mycube @shape plane @position 1. 1. 2. @color 1 1 1 1 @name w5 @automatic 0;
#B color 5;
#P newex 707 1179 281 196617 jit.gl.gridshape mycube @shape plane @rotatexyz 90. 0. 1. @position 1 2 -1 @color 0 0 1 1 @name b1 @automatic 0;
#B color 5;
#P newex 713 1245 272 196617 jit.gl.gridshape mycube @shape plane @rotatexyz 90. 0. 1. @position -1 2 -1 @color 0 0 1 1 @name b2 @automatic 0;
#B color 5;
#P newex 709 1143 281 196617 jit.gl.gridshape mycube @shape plane @rotatexyz 90. 0. 1. @position 1 2 1 @color 0 0 1 1 @name b5 @automatic 0;
#B color 5;
#P newex 709 1211 281 196617 jit.gl.gridshape mycube @shape plane @rotatexyz 90. 0. 1. @position -1 2 1 @color 0 0 1 1 @name b8 @automatic 0;
#B color 5;
#P newex 380 1172 276 196617 jit.gl.gridshape mycube @shape plane @rotatexyz 90. 0. 1. @position 1 -2 1 @color 0.5 1 0 1 @name g6 @automatic 0;
#B color 5;
#P newex 377 1243 281 196617 jit.gl.gridshape mycube @shape plane @rotatexyz 90. 0. 1. @position -1 -2 1 @color 0.5 1 0 1 @name g7 @automatic 0;
#B color 5;
#P newex 380 1205 286 196617 jit.gl.gridshape mycube @shape plane @rotatexyz 90. 0. 1. @position -1 -2 -1 @color 0.5 1 0 1 @name g4 @automatic 0;
#B color 5;
#P newex 379 1138 281 196617 jit.gl.gridshape mycube @shape plane @rotatexyz 90. 0. 1. @position 1 -2 -1 @color 0.5 1 0 1 @name g3 @automatic 0;
#B color 5;
#P newex 2 1015 237 196617 jit.gl.gridshape mycube @shape plane @position 1. -1 -2 @color 1 1 0 1 @name y3 @automatic 0;
#B color 5;
#P newex 1 1057 239 196617 jit.gl.gridshape mycube @shape plane @position -1. -1 -2 @color 1 1 0 1 @name y4 @automatic 0;
#B color 5;
#P newex 0 975 234 196617 jit.gl.gridshape mycube @shape plane @position -1. 1 -2 @color 1 1 0 1 @name y2 @automatic 0;
#B color 5;
#P newex 3 942 238 196617 jit.gl.gridshape mycube @shape plane @position 1. 1. -2. @color 1 1 0 1 @name y1 @automatic 0;
#B color 5;
#P window linecount 3;
#P comment 322 253 100 196617 Hit this button to rotate counterclockwise;
#P connect 30 0 26 0;
#P connect 26 0 27 0;
#P connect 28 0 31 0;
#P connect 27 2 28 0;
#P connect 27 0 28 0;
#P connect 36 0 28 0;
#P connect 116 0 28 0;
#P connect 74 0 63 0;
#P connect 63 0 62 0;
#P connect 59 0 58 0;
#P connect 99 0 59 0;
#P connect 102 0 99 0;
#P connect 101 0 99 0;
#P connect 76 0 74 0;
#P connect 77 0 74 0;
#P connect 32 0 26 1;
#P connect 100 0 99 1;
#P connect 75 0 74 1;
#P connect 98 0 99 2;
#P connect 64 0 74 2;
#P connect 27 1 29 0;
#P connect 73 0 98 0;
#P connect 37 0 36 0;
#P connect 43 0 42 0;
#P connect 104 0 43 0;
#P connect 68 0 67 0;
#P connect 82 0 79 0;
#P connect 81 0 79 0;
#P connect 79 0 68 0;
#P connect 106 0 104 0;
#P connect 107 0 104 0;
#P connect 80 0 79 1;
#P connect 105 0 104 1;
#P connect 78 0 79 2;
#P connect 103 0 104 2;
#P connect 73 0 103 0;
#P connect 38 0 34 0;
#P connect 34 0 35 0;
#P connect 35 0 25 0;
#P connect 33 0 38 0;
#P connect 115 0 113 0;
#P connect 117 0 115 0;
#P connect 113 0 73 0;
#P connect 114 0 73 0;
#P connect 66 0 65 0;
#P connect 109 0 66 0;
#P connect 112 0 109 0;
#P connect 111 0 109 0;
#P connect 86 0 84 0;
#P connect 87 0 84 0;
#P connect 70 0 69 0;
#P connect 84 0 70 0;
#P connect 110 0 109 1;
#P connect 85 0 84 1;
#P connect 108 0 109 2;
#P connect 83 0 84 2;
#P connect 73 0 108 0;
#P connect 115 0 114 0;
#P connect 92 0 89 0;
#P connect 91 0 89 0;
#P connect 72 0 71 0;
#P connect 89 0 72 0;
#P connect 90 0 89 1;
#P connect 119 0 96 0;
#P connect 118 0 96 0;
#P connect 61 0 60 0;
#P connect 94 0 61 0;
#P connect 96 0 94 0;
#P connect 97 0 94 0;
#P connect 88 0 89 2;
#P connect 95 0 94 1;
#P connect 119 0 95 0;
#P connect 118 0 95 0;
#P connect 93 0 94 2;
#P connect 73 0 93 0;
#P connect 41 0 40 0;
#P connect 39 0 41 0;
#P connect 39 0 45 0;
#P connect 45 0 44 0;
#P connect 47 0 46 0;
#P connect 39 0 47 0;
#P connect 49 0 48 0;
#P connect 39 0 49 0;
#P connect 51 0 50 0;
#P connect 39 0 51 0;
#P connect 53 0 52 0;
#P connect 39 0 53 0;
#P connect 55 0 54 0;
#P connect 39 0 55 0;
#P connect 57 0 56 0;
#P connect 39 0 57 0;
#P pop;



More information about the jitter mailing list