Forums > Jitter

Direction & Speed of an object using two inputs

August 20, 2007 | 8:57 pm

Dear all,

I am looking to control an OpenGL object such as a square or circle using two numerical inputs.

1. A number between -5 and 5. This determines Speed at which the object is moving and if it is moving backwards or forwards.

2. A number between 0 and 360. This dictates the angle of the relative to the screen. 0 being vertically up.

In other words, lets say the first was a value of 2 and the second input was a value of 45, the object would be moving across the screen, forwards, at a fairly low speed and would be traveling up at an angle of 45 degrees (assume 0 degrees is vertically up). If the first input moved to a value of 5 then the speed at which it moved in that direction would be much faster. If we changed the second input, the object will steer round and head in the corresponding direction.

Can anyone help me with this please?

J.


August 20, 2007 | 9:14 pm

Just search the jitter forum for a thread called "patch for game-like
navigation through gl space" – it’s all in there.

Andreas.


August 22, 2007 | 10:27 am

Thanks,

Have looked, still trying to fingure out how to link it up so i can use it prooperly!


August 22, 2007 | 12:26 pm

Here is some more information on what it is i am trying to achieve:

Take a look at the attached JPG as it shows how it would look.

My biggest problem at th moment, is sorting the maths out so the two values will produce x,y coordinates for the object to move to. ‘Input1′ (a value between -10 and 10) controls whether our object is moving forwards (+), or backwards (-), and how fast (depending on the value 10 being fastest). The second input, ‘Input2′ is going to be a value between 0 and 360 which corresponds to the orientation of the object, in degrees, locally to the object (0 being vertically up). So for example, a value of 10 on input1 and value of 45 on input2 will mean that our object (a small dot) is moving diagonally up, towards the right of the screen, at its maximum speed. If the input2 value altered to 270, the direction of the object would change to heading towards the left. Basically these two values act like the two controls on the transmitter of a radio controlled car and we are looking directly down at our RC car which is represented by a dot.

I have the motion tracking of the balloon working. One part of the patch tracks the overall position of the balloon and the other tracks the position of a red dot on the balloon. Input1 uses the ‘x’ information gathered as raw data and Input2 will use jit.findbounds to calculate the distance from the left-hand side of the balloon to the center of the red dot. We know that the balloon is 6 feet in diameter so we can work out the rotational angle of the balloon and then range this into a sensible value between 0 and 360.


August 22, 2007 | 4:47 pm

J.

Here is a modified version of my glNavigator abstraction. It does exactly what you ask here, tell me if there’s anything confusing or incorrect.

max v2;
#N vpatcher 451 94 952 376;
#P window setfont Geneva 9.;
#P window linecount 1;
#P hidden newex 379 157 63 196617 loadmess 0.;
#P comment 246 192 52 196617 turn it on;
#P toggle 263 207 15 0;
#P window linecount 2;
#P comment 378 181 58 196617 rotation mod 360;
#P comment 316 181 50 196617 speed 10. to 10.;
#P flonum 321 208 35 9 -10. 10. 3 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P flonum 379 208 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P flonum 182 94 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P window linecount 1;
#P newex 95 116 97 196617 pak camera 0. 0. 4.;
#N vpatcher 10 59 855 544;
#P inlet 210 131 15 0;
#P inlet 443 32 15 0;
#P inlet 279 32 15 0;
#P window setfont Geneva 9.;
#P window linecount 3;
#P comment 595 130 209 196617 < --this converts degrees into radians and makes for a clockwise rotation (if 3.141593 were positive it would be counterclockwise);
#P window linecount 2;
#P comment 564 80 128 196617 < --this rotates 0 degrees to be pointing straight up;
#P flonum 443 107 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P flonum 443 56 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P window linecount 1;
#P newex 443 79 120 196617 expr ($f1 – 90.) % 360.;
#P comment 24 82 254 196617 change 2nd & 3rd args. to adjust speed in gl space –>;
#P comment 315 56 94 196617 speed forw/backw;
#P flonum 368 333 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P newex 279 106 53 196617 t b f b f;
#P flonum 253 333 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P newex 180 387 102 196617 pak position 0. 0. 0.;
#P window linecount 2;
#P newex 180 418 220 196617 jit.gl.gridshape test @shape sphere @scale 0.1 0.1 0.1 @lighting_enable 1 @depth_enable 1;
#P window linecount 1;
#P comment 478 157 43 196617 radians;
#P flonum 443 157 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P newex 443 131 151 196617 expr ($f1 /180.) * -3.141593;
#P newex 279 80 127 196617 scale -10. 10. -0.01 0.01;
#P newex 323 354 40 196617 line 0.;
#P message 323 333 37 196617 $1 10;
#P newex 210 354 40 196617 line 0.;
#P newex 357 274 29 196617 * 0.;
#P newex 244 273 29 196617 * 0.;
#P window linecount 2;
#P comment 370 300 53 196617 speed on z axis;
#P window linecount 1;
#P newex 357 250 21 196617 sin;
#P newex 323 273 27 196617 t f f;
#P newex 323 250 27 196617 f 0.;
#P newex 340 305 27 196617 + 0.;
#P newex 210 197 30 196617 t b b;
#P newex 244 250 23 196617 cos;
#P newex 210 273 27 196617 t f f;
#P toggle 210 155 15 0;
#P newex 210 250 27 196617 f 0.;
#P newex 227 305 27 196617 + 0.;
#P newex 210 176 57 196617 qmetro 10;
#P window linecount 2;
#P comment 257 300 55 196617 speed on x axis;
#P window linecount 1;
#P message 210 333 37 196617 $1 10;
#P flonum 279 56 35 9 -10. 10. 3 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P comment 480 56 45 196617 degrees;
#P connect 26 0 25 0;
#P connect 39 0 7 0;
#P connect 7 0 4 0;
#P connect 4 0 10 0;
#P connect 10 0 6 0;
#P connect 6 0 8 0;
#P connect 8 0 2 0;
#P connect 2 0 18 0;
#P connect 18 0 26 1;
#P fasten 5 0 6 1 232 327 316 327 316 237 232 237;
#P connect 8 1 5 0;
#P fasten 20 0 26 2 328 379 245 379;
#P connect 23 0 9 0;
#P lcolor 13;
#P connect 28 0 9 0;
#P lcolor 7;
#P connect 9 0 16 0;
#P connect 16 0 5 1;
#P connect 5 0 27 0;
#P connect 28 1 16 1;
#P lcolor 7;
#P connect 37 0 1 0;
#P connect 1 0 21 0;
#P connect 21 0 28 0;
#P fasten 10 1 12 0 235 232 328 232;
#P connect 12 0 13 0;
#P connect 13 0 19 0;
#P connect 19 0 20 0;
#P fasten 11 0 12 1 345 328 428 328 428 236 345 236;
#P connect 13 1 11 0;
#P connect 23 0 14 0;
#P lcolor 13;
#P connect 28 2 14 0;
#P lcolor 7;
#P connect 14 0 17 0;
#P connect 17 0 11 1;
#P connect 11 0 29 0;
#P connect 28 3 17 1;
#P lcolor 7;
#P connect 38 0 33 0;
#P connect 33 0 32 0;
#P connect 32 0 34 0;
#P connect 34 0 22 0;
#P connect 22 0 23 0;
#P pop;
#P newobj 263 232 126 196617 p your_solution;
#B color 12;
#P window setfont "Sans Serif" 9.;
#P newex 14 85 43 131137545 jit.qball;
#P number 59 36 35 9 0 0 0 2001 0 0 0 221 221 221 222 222 222 0 0 0;
#P toggle 14 36 15 0;
#P newex 14 62 55 131137545 metro 20;
#P newex 14 116 47 131137545 t b erase;
#P toggle 98 187 15 0;
#P newex 59 186 35 131137545 sel 27;
#P message 98 205 68 131137545 fullscreen $1;
#P newex 16 229 135 131137545 jit.window test @depthbuffer 1;
#P newex 14 186 40 131137545 key;
#P newex 14 153 254 131137545 jit.gl.render test @erase_color 0. 0. 0. 1. @camera 0. 0. 4.;
#P window setfont Geneva 9.;
#P window linecount 2;
#P comment 181 66 257 196617 move camera "back" (i.e. higher numbers) if you want to have more viewable distance on the x and y axes;
#P window linecount 1;
#P comment 251 25 231 196617 a modified version of my glNavigator abstraction;
#P connect 10 0 9 0;
#P connect 9 0 12 0;
#P connect 12 0 8 0;
#P fasten 8 1 2 0 56 142 19 142;
#P connect 8 0 2 0;
#P fasten 14 0 2 0 100 146 19 146;
#P fasten 5 0 4 0 103 224 21 224;
#P connect 11 0 9 1;
#P fasten 3 0 6 0 19 205 56 205 56 184 64 184;
#P fasten 6 0 7 0 64 204 95 204 95 184 103 184;
#P connect 7 0 5 0;
#P connect 15 0 14 3;
#P connect 20 0 13 0;
#P connect 17 0 13 1;
#P hidden connect 22 0 16 0;
#P connect 16 0 13 2;
#P pop;


August 22, 2007 | 5:25 pm

Wow!

Thats brilliant. The next two things I have to do is get it to leave a line where its been and when it creeps off the edge of the screen, come on the other side!

Thanks so much. Here’s the raw patch its going onto…

max v2;
#N vpatcher 173 59 1611 878;
#P origin -106 -176;
#P window setfont "Sans Serif" 9.;
#N vpatcher 570 259 1060 408;
#P window setfont "Sans Serif" 9.;
#P newex 50 50 83 196617 prepend position;
#P newex 50 73 353 196617 jit.gl.gridshape preview @shape circle @scale 0.1 0.1 0.1 @color 0. 0. 1. 1.;
#P inlet 50 30 15 0;
#P connect 0 0 2 0;
#P connect 2 0 1 0;
#P pop;
#P newobj 825 785 44 196617 p circle;
#N vpatcher 30 89 787 459;
#P window setfont "Sans Serif" 9.;
#P window linecount 1;
#P comment 402 128 153 196617 to jit.gl.render;
#P comment 402 112 184 196617 see screentoworld message;
#P newex 50 111 183 196617 pack 0. 0.;
#P newex 223 85 170 196617 scale 0. 240. 0.828428 -0.828428;
#P newex 50 85 158 196617 scale 0. 320. -1.10457 1.10457;
#P newex 50 50 95 196617 unpack 0. 0.;
#P inlet 50 30 15 0;
#P outlet 50 133 15 0;
#P window linecount 0;
#P comment 402 80 153 196617 this maps pixel 320×240 to opengl coordinates;
#P connect 2 0 3 0;
#P connect 3 0 4 0;
#P connect 4 0 6 0;
#P connect 6 0 1 0;
#P connect 3 1 5 0;
#P connect 5 0 6 1;
#P pop;
#P newobj 825 722 133 196617 p screentoworld(320×240);
#P newex 1208 763 122 196617 vexpr $f1+($f2-$f1)/2.;
#N vpatcher 30 89 692 549;
#P window setfont "Sans Serif" 9.;
#P window linecount 1;
#P newex 90 305 161 196617 pack 0. 0.;
#P newex 90 278 55 196617 snapshot~;
#P newex 178 236 30 196617 t b b;
#P newex 90 182 66 196617 pack 0. 180.;
#P newex 90 209 32 196617 line~;
#P window linecount 0;
#P newex 90 127 64 196617 unpack 0. 0.;
#P window linecount 1;
#P newex 241 274 55 196617 snapshot~;
#P newex 178 213 31 196617 r r.b;
#P window linecount 0;
#P newex 90 50 317 196617 t l b b;
#N vpatcher 525 182 715 430;
#N comlet interval in ms is reported here;
#P outlet 66 173 15 0;
#P window setfont "Sans Serif" 9.;
#P newex 96 104 46 196617 cpuclock;
#P newex 66 143 27 196617 – 0.;
#P newex 48 104 46 196617 cpuclock;
#N comlet bang stops timing and reports interval;
#P inlet 96 58 15 0;
#N comlet bang starts timing interval;
#P inlet 48 58 15 0;
#P connect 0 0 2 0;
#P connect 4 0 3 0;
#P connect 3 0 5 0;
#P connect 2 0 3 1;
#P connect 1 0 4 0;
#P pop;
#P newobj 297 121 55 196617 p cputimer;
#P newex 241 178 66 196617 pack 0. 180.;
#P newex 241 205 32 196617 line~;
#P inlet 90 30 15 0;
#P outlet 90 334 15 0;
#P connect 1 0 5 0;
#P connect 5 0 8 0;
#P connect 8 0 10 0;
#P connect 10 0 9 0;
#P connect 11 0 12 0;
#P connect 9 0 12 0;
#P connect 12 0 13 0;
#P connect 13 0 0 0;
#P connect 4 0 10 1;
#P connect 6 0 11 0;
#P connect 8 1 3 0;
#P connect 3 0 2 0;
#P connect 11 1 7 0;
#P connect 2 0 7 0;
#P connect 7 0 13 1;
#P connect 5 1 4 0;
#P connect 4 0 3 1;
#P connect 5 2 4 1;
#P pop;
#P newobj 825 757 73 196617 p xy-smooth~;
#P flonum -2 465 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P newex -3 426 36 196617 – 160;
#P flonum -3 397 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P flonum -16 563 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P newex 25 536 103 196617 scale -40 40 -16 16;
#P newex 9 352 40 196617 unpack;
#N vpatcher 30 89 520 238;
#P window setfont "Sans Serif" 9.;
#P newex 50 50 83 196617 prepend position;
#P newex 50 73 353 196617 jit.gl.gridshape preview @shape circle @scale 0.1 0.1 0.1 @color 0. 0. 1. 1.;
#P inlet 50 30 15 0;
#P connect 0 0 2 0;
#P connect 2 0 1 0;
#P pop;
#P newobj -7 726 44 196617 p circle;
#N vpatcher 30 89 787 459;
#P window setfont "Sans Serif" 9.;
#P window linecount 1;
#P comment 402 128 153 196617 to jit.gl.render;
#P comment 402 112 184 196617 see screentoworld message;
#P newex 50 111 183 196617 pack 0. 0.;
#P newex 223 85 170 196617 scale 0. 240. 0.828428 -0.828428;
#P newex 50 85 158 196617 scale 0. 320. -1.10457 1.10457;
#P newex 50 50 95 196617 unpack 0. 0.;
#P inlet 50 30 15 0;
#P outlet 50 133 15 0;
#P window linecount 0;
#P comment 402 80 153 196617 this maps pixel 320×240 to opengl coordinates;
#P connect 2 0 3 0;
#P connect 3 0 4 0;
#P connect 4 0 6 0;
#P connect 6 0 1 0;
#P connect 3 1 5 0;
#P connect 5 0 6 1;
#P pop;
#P newobj -7 663 133 196617 p screentoworld(320×240);
#P newex 529 728 122 196617 vexpr $f1+($f2-$f1)/2.;
#N vpatcher 30 89 692 549;
#P window setfont "Sans Serif" 9.;
#P window linecount 1;
#P newex 90 305 161 196617 pack 0. 0.;
#P newex 90 278 55 196617 snapshot~;
#P newex 178 236 30 196617 t b b;
#P newex 90 182 66 196617 pack 0. 180.;
#P newex 90 209 32 196617 line~;
#P window linecount 0;
#P newex 90 127 64 196617 unpack 0. 0.;
#P window linecount 1;
#P newex 241 274 55 196617 snapshot~;
#P newex 178 213 31 196617 r r.b;
#P window linecount 0;
#P newex 90 50 317 196617 t l b b;
#N vpatcher 525 182 715 430;
#N comlet interval in ms is reported here;
#P outlet 66 173 15 0;
#P window setfont "Sans Serif" 9.;
#P newex 96 104 46 196617 cpuclock;
#P newex 66 143 27 196617 – 0.;
#P newex 48 104 46 196617 cpuclock;
#N comlet bang stops timing and reports interval;
#P inlet 96 58 15 0;
#N comlet bang starts timing interval;
#P inlet 48 58 15 0;
#P connect 0 0 2 0;
#P connect 4 0 3 0;
#P connect 3 0 5 0;
#P connect 2 0 3 1;
#P connect 1 0 4 0;
#P pop;
#P newobj 297 121 55 196617 p cputimer;
#P newex 241 178 66 196617 pack 0. 180.;
#P newex 241 205 32 196617 line~;
#P inlet 90 30 15 0;
#P outlet 90 334 15 0;
#P connect 1 0 5 0;
#P connect 5 0 8 0;
#P connect 8 0 10 0;
#P connect 10 0 9 0;
#P connect 9 0 12 0;
#P connect 11 0 12 0;
#P connect 12 0 13 0;
#P connect 13 0 0 0;
#P connect 4 0 10 1;
#P connect 6 0 11 0;
#P connect 8 1 3 0;
#P connect 3 0 2 0;
#P connect 2 0 7 0;
#P connect 11 1 7 0;
#P connect 7 0 13 1;
#P connect 5 1 4 0;
#P connect 4 0 3 1;
#P connect 5 2 4 1;
#P pop;
#P newobj -7 698 73 196617 p xy-smooth~;
#P message 1341 36 31 196617 12.2;
#P message 1256 41 20 196617 54;
#P message 1169 40 31 196617 0.03;
#P message 1072 38 14 196617 0;
#P message 989 39 25 196617 -49;
#P message 897 39 31 196617 1.32;
#P newex -41 305 193 196617 jit.window preview @sync 0 @floating 1;
#P user ezdac~ -1 15 43 48 0;
#P comment 51 89 115 196617 rendering fps;
#P user jit.fpsgui -13 81 60 196617 0;
#P newex -25 216 105 196617 jit.gl.render preview;
#P newex -25 112 134 196617 t b b erase b;
#P toggle -25 22 15 0;
#P newex -25 54 50 196617 qmetro 5;
#P newex 16 155 34 196617 s r.b;
#P window linecount 7;
#P comment 250 9 319 196617 1. read the motion_test.mov , check and un check the metro check box so the movie is displayed in both the upper matrix. 2. Set the brightness , contrast and saturation for both the video feeds to the values above. 3. In the Left-hand , upper matrix , pick the balloon’s colour (now black) 4. In the Right-hand , upper marix pick the red dot on the balloon. 5. Check the metro checkbox to begin the movie playing;
#B color 7;
#P window linecount 1;
#P comment 711 198 101 196617 5. Pick Red here>>>;
#B color 7;
#P comment 697 4 186 196617 1. Load motion_test.mov in and pause it.;
#B color 7;
#P comment 1172 4 187 196617 3. Set to these values;
#B color 7;
#P comment 103 203 101 196617 4. Pick Black here>>>;
#B color 7;
#P comment 1333 20 29 196617 12.2;
#P comment 1250 23 29 196617 54;
#P comment 1166 21 29 196617 0.03;
#P comment 1067 17 29 196617 0;
#P comment 984 20 29 196617 -49;
#P window setfont "Lucida Grande" 10.;
#P message 1069 61 83 67108874 saturation $1;
#P message 983 61 73 67108874 contrast $1;
#P message 897 61 83 67108874 brightness $1;
#P window setfont "Lucida Grande" 9.;
#P newex 705 659 27 67108873 gate;
#P number 704 681 35 9 0 0 0 1024 0 0 0 221 221 221 222 222 222 0 0 0;
#P number 684 632 35 9 0 0 0 1024 0 0 0 221 221 221 222 222 222 0 0 0;
#P newex 684 608 27 67108873 > 1;
#P number 684 587 35 9 0 0 0 1024 0 0 0 221 221 221 222 222 222 0 0 0;
#P newex 626 654 27 67108873 gate;
#P number 602 680 35 9 0 0 0 1024 0 0 0 221 221 221 222 222 222 0 0 0;
#P number 608 629 35 9 0 0 0 1024 0 0 0 221 221 221 222 222 222 0 0 0;
#P newex 608 605 35 67108873 < 239;
#P number 608 584 35 9 0 0 0 1024 0 0 0 221 221 221 222 222 222 0 0 0;
#P window setfont "Lucida Grande" 10.;
#P newex 225 141 68 67108874 jit.brcosa;
#P user suckah 210 176 162 122;
#P window setfont "Lucida Grande" 9.;
#P newex 611 320 93 67108873 unpack 0. 0. 0.;
#P newex 611 295 77 67108873 vexpr $i1/255.;
#P user swatch 406 304 128 32;
#P flonum 693 345 35 9 0 0 0 1024 0 0 0 221 221 221 222 222 222 0 0 0;
#P flonum 652 345 35 9 0 0 0 1024 0 0 0 221 221 221 222 222 222 0 0 0;
#P flonum 611 345 35 9 0 0 0 1024 0 0 0 221 221 221 222 222 222 0 0 0;
#P flonum 572 345 35 9 0 0 0 1024 0 0 0 221 221 221 222 222 222 0 0 0;
#P newex 571 370 91 67108873 pak min 0. 0. 0. 0.;
#P window setfont "Lucida Grande" 10.;
#P user jit.fpsgui 211 309 60 67108874 0;
#P user jit.pwindow 210 176 162 122 0 1 0 0 1 0;
#P user uslider 528 356 13 225 240 1 0 0;
#P newex 571 509 140 67108874 expr $i1+(($i2-$i1)/2);
#P newex 609 530 173 67108874 expr 239-($i1+(($i2-$i1)/2));
#P number 685 472 35 10 0 0 0 1024 0 0 0 221 221 221 222 222 222 0 0 0;
#P number 647 472 35 10 0 0 0 1024 0 0 0 221 221 221 222 222 222 0 0 0;
#P number 609 472 35 10 0 0 0 1024 0 0 0 221 221 221 222 222 222 0 0 0;
#P number 571 472 35 10 0 0 0 1024 0 0 0 221 221 221 222 222 222 0 0 0;
#P newex 647 451 48 67108874 unpack;
#P newex 571 451 48 67108874 unpack;
#P user jit.pwindow 207 355 322 242 0 1 0 0 1 0;
#P window linecount 3;
#P newex 571 402 123 67108874 jit.findbounds @min 0. 0.8 0.3 0. @max 1. 1. 0.1 0.1;
#B color 5;
#P user hslider 209 599 13 305 320 1 0 0;
#P window linecount 1;
#P message 735 25 32 67108874 read;
#P toggle 678 4 15 0;
#P newex 678 24 50 67108874 metro 2;
#P window setfont "Lucida Grande" 9.;
#P newex 1307 637 27 67108873 gate;
#P number 1306 659 35 9 0 0 0 1024 0 0 0 221 221 221 222 222 222 0 0 0;
#P number 1286 610 35 9 0 0 0 1024 0 0 0 221 221 221 222 222 222 0 0 0;
#P newex 1286 586 27 67108873 > 1;
#P number 1286 565 35 9 0 0 0 1024 0 0 0 221 221 221 222 222 222 0 0 0;
#P newex 1228 632 27 67108873 gate;
#P number 1204 658 35 9 0 0 0 1024 0 0 0 221 221 221 222 222 222 0 0 0;
#P number 1210 607 35 9 0 0 0 1024 0 0 0 221 221 221 222 222 222 0 0 0;
#P newex 1210 583 35 67108873 < 239;
#P number 1210 562 35 9 0 0 0 1024 0 0 0 221 221 221 222 222 222 0 0 0;
#P window setfont "Lucida Grande" 10.;
#P message 1340 61 83 67108874 saturation $1;
#P message 1254 61 73 67108874 contrast $1;
#P message 1168 61 83 67108874 brightness $1;
#P newex 827 119 68 67108874 jit.brcosa;
#P user suckah 812 154 162 122;
#P window setfont "Lucida Grande" 9.;
#P newex 1213 298 93 67108873 unpack 0. 0. 0.;
#P newex 1213 273 77 67108873 vexpr $i1/255.;
#P user swatch 1008 282 128 32;
#P flonum 1295 323 35 9 0 0 0 1024 0 0 0 221 221 221 222 222 222 0 0 0;
#P flonum 1254 323 35 9 0 0 0 1024 0 0 0 221 221 221 222 222 222 0 0 0;
#P flonum 1213 323 35 9 0 0 0 1024 0 0 0 221 221 221 222 222 222 0 0 0;
#P flonum 1174 323 35 9 0 0 0 1024 0 0 0 221 221 221 222 222 222 0 0 0;
#P newex 1173 348 91 67108873 pak min 0. 0. 0. 0.;
#P window setfont "Lucida Grande" 10.;
#P user jit.fpsgui 813 287 60 67108874 0;
#P user jit.pwindow 812 154 162 122 0 1 0 0 1 0;
#P newex 643 60 65 67108874 jit.qt.movie;
#B color 5;
#P user uslider 1130 334 13 225 240 1 0 0;
#P newex 1173 487 140 67108874 expr $i1+(($i2-$i1)/2);
#P newex 1211 508 173 67108874 expr 239-($i1+(($i2-$i1)/2));
#P number 1287 450 35 10 0 0 0 1024 0 0 0 221 221 221 222 222 222 0 0 0;
#P number 1249 450 35 10 0 0 0 1024 0 0 0 221 221 221 222 222 222 0 0 0;
#P number 1211 450 35 10 0 0 0 1024 0 0 0 221 221 221 222 222 222 0 0 0;
#P number 1173 450 35 10 0 0 0 1024 0 0 0 221 221 221 222 222 222 0 0 0;
#P newex 1249 429 48 67108874 unpack;
#P newex 1173 429 48 67108874 unpack;
#P user jit.pwindow 809 333 322 242 0 1 0 0 1 0;
#P window linecount 3;
#P newex 1173 380 123 67108874 jit.findbounds @min 0. 0.8 0.3 0. @max 1. 1. 0.1 0.1;
#B color 5;
#P user hslider 810 574 13 305 320 1 0 0;
#P window setfont "Sans Serif" 9.;
#P window linecount 1;
#P comment 903 20 29 196617 1.32;
#P comment 901 3 188 196617 2. Set to these values;
#B color 7;
#P connect 92 0 91 0;
#P connect 91 0 93 0;
#P fasten 93 2 94 0 62 182 -20 182;
#P fasten 93 0 94 0 -20 192 -20 192;
#P connect 110 0 111 0;
#P connect 91 0 95 0;
#P connect 106 0 107 0;
#P connect 107 0 105 0;
#P connect 105 0 108 0;
#P connect 109 0 112 0;
#P connect 112 0 113 0;
#P connect 113 0 114 0;
#P connect 106 0 109 0;
#P connect 93 1 90 0;
#P connect 114 0 110 0;
#P fasten 14 0 45 0 648 103 213 103;
#P fasten 75 0 43 0 709 711 202 711 202 590 213 590 213 595 214 595;
#P fasten 66 0 55 0 230 168 216 168;
#P connect 55 0 56 0;
#P fasten 14 0 66 0 648 107 230 107;
#P fasten 79 0 66 0 1074 109 230 109;
#P fasten 78 0 66 0 988 109 230 109;
#P fasten 77 0 66 0 902 109 230 109;
#P fasten 65 0 62 0 215 304 380 304 380 292 411 292;
#P fasten 70 0 54 0 607 711 582 711 582 713 582 593 556 593 556 341 533 341;
#P connect 44 0 106 0;
#P fasten 66 0 44 0 230 169 378 169 378 269 563 269 563 406;
#P connect 57 0 44 0;
#P connect 44 0 46 0;
#P connect 46 0 48 0;
#P connect 48 0 53 0;
#P connect 58 0 57 1;
#P connect 71 0 70 0;
#P connect 52 0 67 0;
#P connect 67 0 68 0;
#P connect 68 0 69 0;
#P connect 46 1 49 0;
#P connect 49 0 52 0;
#P fasten 62 0 63 0 411 348 542 348 542 289 616 289;
#P connect 63 0 64 0;
#P connect 64 0 59 0;
#P connect 59 0 57 2;
#P connect 69 0 71 0;
#P connect 60 0 57 3;
#P connect 44 1 106 1;
#P fasten 40 0 14 0 683 51 648 51;
#P fasten 42 0 14 0 740 51 648 51;
#P fasten 52 0 71 1 614 575 648 575;
#P fasten 44 1 47 0 632 447 652 447;
#P connect 47 0 50 0;
#P connect 61 0 57 4;
#P connect 64 1 60 0;
#P connect 41 0 40 0;
#P fasten 53 0 72 0 576 565 689 565;
#P connect 72 0 73 0;
#P connect 73 0 74 0;
#P connect 47 1 51 0;
#P connect 64 2 61 0;
#P fasten 50 0 53 1 652 505 706 505;
#P connect 76 0 75 0;
#P connect 74 0 76 0;
#P fasten 53 0 76 1 576 566 727 566;
#P fasten 51 0 52 1 690 501 777 501;
#P fasten 14 0 4 0 648 123 707 123 707 326 815 326;
#P fasten 38 0 2 0 1311 689 804 689 804 568 815 568 815 573 815 573;
#P connect 26 0 15 0;
#P connect 15 0 16 0;
#P connect 116 0 117 0;
#P connect 117 0 115 0;
#P connect 115 0 118 0;
#P fasten 14 0 26 0 648 98 832 98;
#P fasten 29 0 26 0 1345 88 832 88;
#P fasten 28 0 26 0 1259 88 832 88;
#P fasten 27 0 26 0 1173 88 832 88;
#P connect 99 0 77 0;
#P connect 100 0 78 0;
#P fasten 25 0 22 0 817 282 982 282 982 270 1013 270;
#P connect 101 0 79 0;
#P fasten 33 0 13 0 1209 689 1184 689 1184 691 1184 571 1158 571 1158 319 1135 319;
#P connect 102 0 27 0;
#P fasten 26 0 3 0 832 147 980 147 980 247 1165 247 1165 384;
#P connect 17 0 3 0;
#P connect 3 0 5 0;
#P connect 5 0 7 0;
#P connect 7 0 12 0;
#P connect 18 0 17 1;
#P connect 34 0 33 0;
#P connect 3 0 116 0;
#P connect 11 0 30 0;
#P connect 30 0 31 0;
#P connect 31 0 32 0;
#P connect 5 1 8 0;
#P connect 8 0 11 0;
#P fasten 22 0 23 0 1013 326 1144 326 1144 267 1218 267;
#P connect 23 0 24 0;
#P connect 24 0 19 0;
#P connect 19 0 17 2;
#P connect 32 0 34 0;
#P connect 20 0 17 3;
#P fasten 11 0 34 1 1216 553 1250 553;
#P fasten 3 1 6 0 1234 425 1254 425;
#P connect 6 0 9 0;
#P connect 21 0 17 4;
#P connect 103 0 28 0;
#P connect 24 1 20 0;
#P fasten 12 0 35 0 1178 543 1291 543;
#P connect 35 0 36 0;
#P connect 36 0 37 0;
#P connect 6 1 10 0;
#P connect 24 2 21 0;
#P fasten 9 0 12 1 1254 483 1308 483;
#P connect 39 0 38 0;
#P connect 37 0 39 0;
#P connect 3 1 116 1;
#P fasten 12 0 39 1 1178 544 1329 544;
#P connect 104 0 29 0;
#P fasten 10 0 11 1 1292 479 1379 479;
#P pop;

The left hand tracker will be Input1 (forward/backward speed), it will also give me the min bound of the overall balloon. The Right hand side will track the red dot on the balloon. Knowing where the dot is in relation to the edge of the balloon (being that the balloon is 6 feet in diameter) will allow me to translate its rotation. This data, once ranged will be Input2 data! these to sets of data will then control that openGL dots movement.

Basically, there wil be a 6 foot weather balloon and a camera looking at it. I have attached a test movie which crudely simulates the balloon with a dot on it. I can’t get into the actual space until Friday so touchh wood I hope this all works out!!! if you have any other ideas as to drawing the line and making the openGL dot wrap I would love to hear them. Hopefully, if I get time i would like to make the line andd dot look a little more interesting.

J.


August 22, 2007 | 5:37 pm

J.

I haven’t read your previous post yet, but I forgot to add objedt-rotation to the previous patch. Here it is, in case you need it.

Zachary

max v2;
#N vpatcher 451 94 952 376;
#P window setfont Geneva 9.;
#P hidden newex 379 157 63 196617 loadmess 0.;
#P comment 246 192 52 196617 turn it on;
#P toggle 263 207 15 0;
#P window linecount 2;
#P comment 378 181 58 196617 rotation mod 360;
#P comment 316 181 50 196617 speed 10. to 10.;
#P flonum 321 208 35 9 -10. 10. 3 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P flonum 379 208 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P flonum 182 94 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P window linecount 1;
#P newex 95 116 97 196617 pak camera 0. 0. 4.;
#N vpatcher 347 296 1192 781;
#P window setfont Geneva 9.;
#P window linecount 1;
#P newex 472 360 149 196617 expr ($f1 * 180.) / 3.141593;
#P newex 373 387 109 196617 pak rotatexyz 0. 0. 0.;
#P inlet 210 131 15 0;
#P inlet 443 32 15 0;
#P inlet 279 32 15 0;
#P window linecount 3;
#P comment 595 130 209 196617 < --this converts degrees into radians and makes for a clockwise rotation (if 3.141593 were positive it would be counterclockwise);
#P window linecount 2;
#P comment 564 80 128 196617 < --this rotates 0 degrees to be pointing straight up;
#P flonum 443 107 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P flonum 443 56 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P window linecount 1;
#P newex 443 79 120 196617 expr ($f1 – 90.) % 360.;
#P comment 24 82 254 196617 change 2nd & 3rd args. to adjust speed in gl space –>;
#P comment 315 56 94 196617 speed forw/backw;
#P flonum 368 333 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P newex 279 106 53 196617 t b f b f;
#P flonum 253 333 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P newex 180 387 102 196617 pak position 0. 0. 0.;
#P window linecount 2;
#P newex 180 418 210 196617 jit.gl.gridshape test @shape cube @scale 0.1 0.1 0.1 @lighting_enable 1 @depth_enable 1;
#P window linecount 1;
#P comment 478 157 43 196617 radians;
#P flonum 443 157 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P newex 443 131 151 196617 expr ($f1 /180.) * -3.141593;
#P newex 279 80 127 196617 scale -10. 10. -0.01 0.01;
#P newex 323 354 40 196617 line 0.;
#P message 323 333 37 196617 $1 10;
#P newex 210 354 40 196617 line 0.;
#P newex 357 274 29 196617 * 0.;
#P newex 244 273 29 196617 * 0.;
#P window linecount 2;
#P comment 370 300 53 196617 speed on z axis;
#P window linecount 1;
#P newex 357 250 21 196617 sin;
#P newex 323 273 27 196617 t f f;
#P newex 323 250 27 196617 f 0.;
#P newex 340 305 27 196617 + 0.;
#P newex 210 197 30 196617 t b b;
#P newex 244 250 23 196617 cos;
#P newex 210 273 27 196617 t f f;
#P toggle 210 155 15 0;
#P newex 210 250 27 196617 f 0.;
#P newex 227 305 27 196617 + 0.;
#P newex 210 176 57 196617 qmetro 10;
#P window linecount 2;
#P comment 257 300 55 196617 speed on x axis;
#P window linecount 1;
#P message 210 333 37 196617 $1 10;
#P flonum 279 56 35 9 -10. 10. 3 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P comment 480 56 45 196617 degrees;
#P fasten 40 0 25 0 378 411 185 411;
#P connect 26 0 25 0;
#P connect 39 0 7 0;
#P connect 7 0 4 0;
#P connect 4 0 10 0;
#P connect 10 0 6 0;
#P connect 6 0 8 0;
#P connect 8 0 2 0;
#P connect 2 0 18 0;
#P connect 18 0 26 1;
#P fasten 5 0 6 1 232 327 316 327 316 237 232 237;
#P connect 8 1 5 0;
#P fasten 20 0 26 2 328 379 245 379;
#P connect 23 0 9 0;
#P lcolor 13;
#P connect 28 0 9 0;
#P lcolor 7;
#P connect 9 0 16 0;
#P connect 16 0 5 1;
#P connect 5 0 27 0;
#P connect 28 1 16 1;
#P lcolor 7;
#P connect 37 0 1 0;
#P connect 1 0 21 0;
#P connect 21 0 28 0;
#P fasten 10 1 12 0 235 232 328 232;
#P connect 12 0 13 0;
#P connect 13 0 19 0;
#P connect 19 0 20 0;
#P fasten 11 0 12 1 345 328 428 328 428 236 345 236;
#P connect 13 1 11 0;
#P connect 23 0 14 0;
#P lcolor 13;
#P connect 28 2 14 0;
#P lcolor 7;
#P connect 14 0 17 0;
#P connect 17 0 11 1;
#P connect 11 0 29 0;
#P connect 28 3 17 1;
#P lcolor 7;
#P connect 38 0 33 0;
#P connect 33 0 32 0;
#P connect 32 0 34 0;
#P connect 34 0 22 0;
#P connect 22 0 23 0;
#P connect 23 0 41 0;
#P lcolor 13;
#P connect 41 0 40 3;
#P pop;
#P newobj 263 232 126 196617 p your_solution;
#B color 12;
#P window setfont "Sans Serif" 9.;
#P newex 14 85 43 131137545 jit.qball;
#P number 59 36 35 9 0 0 0 2001 0 0 0 221 221 221 222 222 222 0 0 0;
#P toggle 14 36 15 0;
#P newex 14 62 55 131137545 metro 20;
#P newex 14 116 47 131137545 t b erase;
#P toggle 98 187 15 0;
#P newex 59 186 35 131137545 sel 27;
#P message 98 205 68 131137545 fullscreen $1;
#P newex 16 229 135 131137545 jit.window test @depthbuffer 1;
#P newex 14 186 40 131137545 key;
#P newex 14 153 254 131137545 jit.gl.render test @erase_color 0. 0. 0. 1. @camera 0. 0. 4.;
#P window setfont Geneva 9.;
#P window linecount 2;
#P comment 181 66 257 196617 move camera "back" (i.e. higher numbers) if you want to have more viewable distance on the x and y axes;
#P window linecount 1;
#P comment 251 25 231 196617 a modified version of my glNavigator abstraction;
#P connect 10 0 9 0;
#P connect 9 0 12 0;
#P connect 12 0 8 0;
#P fasten 14 0 2 0 100 146 19 146;
#P connect 8 0 2 0;
#P fasten 8 1 2 0 56 142 19 142;
#P fasten 5 0 4 0 103 224 21 224;
#P connect 11 0 9 1;
#P fasten 3 0 6 0 19 205 56 205 56 184 64 184;
#P fasten 6 0 7 0 64 204 95 204 95 184 103 184;
#P connect 7 0 5 0;
#P connect 15 0 14 3;
#P connect 20 0 13 0;
#P connect 17 0 13 1;
#P hidden connect 22 0 16 0;
#P connect 16 0 13 2;
#P pop;


August 22, 2007 | 6:46 pm

J.

For leaving a trail, one way to do it is just adjust the alpha of the erase_color attribute in the jit.gl.render object.

As for the having it wrap, you can set your gridshape object to @transform_reset 1. This will make it so the x and y coordinates scale between -1. and 1. in your jitter window. Then you can add the if/then scenarios to have the object wrap (i.e. if $f1 < -1. then 1. else $f1)


August 22, 2007 | 6:58 pm

Ok, brilliant, thanks so much again!


August 22, 2007 | 11:28 pm

I got to procrastinating regarding some other things I should have been doing, and, well… here’s the result ;) It wraps and there are some trails.

As for the trails, maybe someone else can clear this up for me. I’ve noticed that when I turn the alpha value of the jit.gl.render’s erase_color down far enough, I get trails that never quite go away. I mean, if I want the background to eventually go back to black, and I set the erase_color to 0. 0. 0. 0.1, it may never quite get there. I know this is because I’m telling it to blend with the color of the object. Is there a way though, that I can get it to fade back to pure black over a long period of time, rather than, as in the attached patch, a very dark red (because the gridshape is red). Sorry for the newb question. Can’t figure it out…

max v2;
#N vpatcher 746 53 1247 335;
#P window setfont Geneva 9.;
#P hidden newex 379 157 63 196617 loadmess 0.;
#P comment 246 192 52 196617 turn it on;
#P toggle 263 207 15 0;
#P window linecount 2;
#P comment 378 181 58 196617 rotation mod 360;
#P comment 316 181 50 196617 speed 10. to 10.;
#P flonum 321 208 35 9 -10. 10. 3 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P flonum 379 208 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P flonum 182 94 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P window linecount 1;
#P newex 95 116 97 196617 pak camera 0. 0. 4.;
#N vpatcher 457 161 1294 812;
#P window setfont Geneva 9.;
#P newex 323 378 27 196617 t f f;
#P newex 210 378 27 196617 t f f;
#P hidden newex 107 337 60 196617 loadmess 1;
#P newex 486 585 27 196617 t f f;
#P message 503 610 39 196617 set $1;
#P newex 395 585 27 196617 t f f;
#P window linecount 0;
#P message 412 610 39 196617 set $1;
#P window linecount 1;
#P newex 529 535 27 196617 + 1.;
#N vpatcher 85 628 423 795;
#P window setfont Geneva 9.;
#P newex 12 94 34 196617 * -1.;
#P inlet 12 34 15 0;
#P inlet 169 34 15 0;
#P outlet 169 125 15 0;
#P newex 169 90 139 196617 if $f1 < ($f2 * -1.) then $f2;
#P newex 12 68 167 196617 if $f1 > $f2 then $f2 else out2 $f1;
#P connect 4 0 0 0;
#P connect 0 0 5 0;
#P connect 3 0 0 1;
#P connect 0 1 1 0;
#P connect 1 0 2 0;
#P fasten 5 0 2 0 17 118 174 118;
#P connect 3 0 1 1;
#P pop;
#P newobj 486 561 53 196617 p wrap_y;
#B color 12;
#N vpatcher 10 59 348 253;
#P inlet 12 34 15 0;
#P inlet 204 34 15 0;
#P outlet 204 154 15 0;
#P window setfont Geneva 9.;
#P newex 204 112 34 196617 * -1.;
#P newex 204 90 104 196617 if $f1 > $f2 then $f2;
#P newex 12 68 202 196617 if $f1 < ($f2 * -1.) then $f2 else out2 $f1;
#P connect 5 0 0 0;
#P connect 4 0 0 1;
#P connect 0 1 1 0;
#P connect 1 0 2 0;
#P connect 2 0 3 0;
#P fasten 0 0 3 0 17 139 209 139;
#P connect 4 0 1 1;
#P pop;
#P newobj 395 561 53 196617 p wrap_x;
#B color 12;
#P newex 535 503 76 196617 unpack 0. 0. 0.;
#P newex 438 535 27 196617 + 0.;
#P newex 443 102 43 196617 % 360.;
#P toggle 107 364 15 0;
#P newex 438 479 205 196617 route dest_dim scale;
#P message 107 411 42 196617 getstate;
#P newex 107 387 63 196617 qmetro 500;
#P newex 438 503 80 196617 expr ($f1/$f2);
#P newex 472 384 149 196617 expr ($f1 * 180.) / 3.141593;
#P newex 373 411 109 196617 pak rotatexyz 0. 0. 0.;
#P inlet 210 131 15 0;
#P inlet 443 32 15 0;
#P inlet 279 32 15 0;
#P window linecount 3;
#P comment 595 149 209 196617 < --this converts degrees into radians and makes for a clockwise rotation (if 3.141593 were positive it would be counterclockwise);
#P window linecount 2;
#P comment 522 79 128 196617 < --this rotates 0 degrees to be pointing straight up;
#P flonum 443 126 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P flonum 443 56 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P window linecount 1;
#P newex 443 79 76 196617 expr $f1 – 90.;
#P comment 24 82 254 196617 change 2nd & 3rd args. to adjust speed in gl space –>;
#P comment 315 56 94 196617 speed forw/backw;
#P flonum 368 333 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P newex 279 106 53 196617 t b f b f;
#P flonum 253 333 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P newex 180 411 102 196617 pak position 0. 0. 0.;
#P window linecount 2;
#P newex 180 442 350 196617 jit.gl.gridshape test @shape cube @scale 0.1 0.1 0.1 @blend_enable 1 @lighting_enable 1 @depth_enable 1 @transform_reset 1 @color 1. 0. 0. 1.;
#P window linecount 1;
#P comment 478 176 43 196617 radians;
#P flonum 443 176 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P newex 443 150 151 196617 expr ($f1 /180.) * -3.141593;
#P newex 279 80 127 196617 scale -10. 10. -0.01 0.01;
#P newex 323 354 40 196617 line 0.;
#P message 323 333 37 196617 $1 10;
#P newex 210 354 40 196617 line 0.;
#P newex 357 274 29 196617 * 0.;
#P newex 244 273 29 196617 * 0.;
#P window linecount 2;
#P comment 370 300 53 196617 speed on z axis;
#P window linecount 1;
#P newex 357 250 21 196617 sin;
#P newex 323 273 27 196617 t f f;
#P newex 323 250 27 196617 f 0.;
#P newex 340 305 27 196617 + 0.;
#P newex 210 197 30 196617 t b b;
#P newex 244 250 23 196617 cos;
#P newex 210 273 27 196617 t f f;
#P toggle 210 155 15 0;
#P newex 210 250 27 196617 f 0.;
#P newex 227 305 27 196617 + 0.;
#P newex 210 176 57 196617 qmetro 10;
#P window linecount 2;
#P comment 257 300 55 196617 speed on x axis;
#P window linecount 1;
#P message 210 333 37 196617 $1 10;
#P flonum 279 56 35 9 -10. 10. 3 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P comment 480 56 45 196617 degrees;
#P hidden connect 57 0 46 0;
#P connect 46 0 43 0;
#P connect 43 0 44 0;
#P fasten 44 0 25 0 112 435 185 435;
#P fasten 40 0 25 0 378 435 185 435;
#P connect 26 0 25 0;
#P connect 39 0 7 0;
#P connect 7 0 4 0;
#P connect 4 0 10 0;
#P connect 10 0 6 0;
#P connect 6 0 8 0;
#P connect 8 0 2 0;
#P connect 2 0 18 0;
#P connect 53 0 18 0;
#P lcolor 4;
#P connect 18 0 58 0;
#P connect 58 0 26 1;
#P fasten 5 0 6 1 232 327 316 327 316 237 232 237;
#P connect 54 0 6 1;
#P lcolor 4;
#P connect 8 1 5 0;
#P fasten 59 0 26 2 328 403 245 403;
#P connect 23 0 9 0;
#P lcolor 13;
#P connect 28 0 9 0;
#P lcolor 7;
#P connect 9 0 16 0;
#P connect 16 0 5 1;
#P connect 5 0 27 0;
#P connect 28 1 16 1;
#P lcolor 7;
#P connect 37 0 1 0;
#P connect 1 0 21 0;
#P connect 21 0 28 0;
#P fasten 10 1 12 0 235 232 328 232;
#P connect 12 0 13 0;
#P connect 13 0 19 0;
#P connect 19 0 20 0;
#P connect 55 0 20 0;
#P lcolor 4;
#P connect 20 0 59 0;
#P fasten 11 0 12 1 345 328 428 328 428 236 345 236;
#P connect 56 0 12 1;
#P lcolor 4;
#P connect 13 1 11 0;
#P connect 23 0 14 0;
#P lcolor 13;
#P connect 28 2 14 0;
#P lcolor 7;
#P connect 14 0 17 0;
#P connect 17 0 11 1;
#P connect 11 0 29 0;
#P connect 28 3 17 1;
#P lcolor 7;
#P connect 58 1 50 0;
#P connect 50 0 54 0;
#P connect 54 1 53 0;
#P fasten 25 1 45 0 525 475 443 475;
#P connect 45 0 42 0;
#P connect 42 0 48 0;
#P connect 48 0 50 1;
#P connect 38 0 33 0;
#P connect 33 0 32 0;
#P connect 32 0 47 0;
#P connect 47 0 34 0;
#P connect 34 0 22 0;
#P connect 22 0 23 0;
#P fasten 49 0 48 1 540 524 460 524;
#P connect 23 0 41 0;
#P lcolor 13;
#P connect 41 0 40 3;
#P connect 59 1 51 0;
#P connect 51 0 56 0;
#P connect 56 1 55 0;
#P fasten 49 1 52 0 573 529 534 529;
#P connect 52 0 51 1;
#P connect 45 1 49 0;
#P pop;
#P newobj 263 232 126 196617 p your_solution;
#B color 12;
#P window setfont "Sans Serif" 9.;
#P newex 14 85 43 131137545 jit.qball;
#P number 59 36 35 9 0 0 0 2001 0 0 0 221 221 221 222 222 222 0 0 0;
#P toggle 14 36 15 0;
#P newex 14 62 55 131137545 metro 20;
#P newex 14 116 47 131137545 t b erase;
#P toggle 98 187 15 0;
#P newex 59 186 35 131137545 sel 27;
#P message 98 205 68 131137545 fullscreen $1;
#P newex 16 229 135 131137545 jit.window test @depthbuffer 1;
#P newex 14 186 40 131137545 key;
#P newex 14 162 259 131137545 jit.gl.render test @erase_color 0. 0. 0. 0.1 @camera 0. 0. 4.;
#P window setfont Geneva 9.;
#P window linecount 2;
#P comment 181 66 257 196617 move camera "back" (i.e. higher numbers) if you want to have more viewable distance on the x and y axes;
#P window linecount 1;
#P comment 251 25 231 196617 a modified version of my glNavigator abstraction;
#P connect 10 0 9 0;
#P connect 9 0 12 0;
#P connect 12 0 8 0;
#P fasten 14 0 2 0 100 146 19 146;
#P connect 8 0 2 0;
#P connect 8 1 2 0;
#P fasten 5 0 4 0 103 224 21 224;
#P connect 11 0 9 1;
#P fasten 3 0 6 0 19 205 56 205 56 184 64 184;
#P fasten 6 0 7 0 64 204 95 204 95 184 103 184;
#P connect 7 0 5 0;
#P connect 15 0 14 3;
#P connect 20 0 13 0;
#P connect 17 0 13 1;
#P hidden connect 22 0 16 0;
#P connect 16 0 13 2;
#P pop;


August 23, 2007 | 1:39 am

And one more version. This creates trails with jit.gl.sketch. Color changes with speed.

max v2;
#N vpatcher 431 99 932 381;
#P window setfont Geneva 9.;
#P hidden newex 379 157 63 196617 loadmess 0.;
#P comment 246 192 52 196617 turn it on;
#P toggle 263 207 15 0;
#P window linecount 2;
#P comment 378 181 58 196617 rotation mod 360;
#P comment 316 181 50 196617 speed 10. to 10.;
#P flonum 321 208 35 9 -10. 10. 3 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P flonum 379 208 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P window linecount 1;
#N vpatcher 457 161 1294 812;
#P window setfont "Sans Serif" 9.;
#P message 25 431 31 131137545 reset;
#P window setfont Geneva 9.;
#N vpatcher 10 59 408 342;
#P inlet 19 107 15 0;
#P window setfont Geneva 9.;
#P newex 249 127 100 196617 expr abs($f1) / 10.;
#P inlet 249 103 15 0;
#P inlet 56 107 15 0;
#P newex 56 129 44 196617 qlim 70;
#P newex 90 177 113 196617 pack 0. 0. 0. 0.;
#P window setfont "Sans Serif" 9.;
#P message 90 198 131 131137545 glcolor 0.5 $4 $3 , point $1 $2;
#P window setfont Geneva 9.;
#P newex 158 30 48 196617 loadbang;
#P newex 158 127 40 196617 line 0.;
#P newex 158 103 69 196617 pack 0. 2000;
#P newex 158 78 40 196617 / 100.;
#P newex 158 55 64 196617 random 100;
#P window setfont "Sans Serif" 9.;
#P message 8 88 31 131137545 reset;
#P window setfont Geneva 9.;
#P newex 56 152 114 196617 unpack position 0. 0. 0.;
#P newex 90 221 263 196617 jit.gl.sketch test @transform_reset 1 @color 1. 0. 0. 1.;
#P connect 11 0 10 0;
#P connect 10 0 1 0;
#P connect 1 1 9 0;
#P connect 9 0 8 0;
#P fasten 14 0 0 0 24 216 95 216;
#P fasten 2 0 0 0 13 216 95 216;
#P connect 8 0 0 0;
#P connect 1 2 9 1;
#P connect 7 0 3 0;
#P fasten 6 1 3 0 193 150 231 150 231 50 163 50;
#P connect 3 0 4 0;
#P connect 4 0 5 0;
#P connect 5 0 6 0;
#P connect 6 0 9 2;
#P fasten 13 0 9 3 254 160 197 160;
#P connect 12 0 13 0;
#P pop;
#P newobj 25 454 78 196617 p trail;
#B color 12;
#P window linecount 0;
#P newex 323 378 27 196617 t f f;
#P newex 210 378 27 196617 t f f;
#P hidden newex 107 337 60 196617 loadmess 1;
#P newex 486 585 27 196617 t f f;
#P message 503 610 39 196617 set $1;
#P newex 395 585 27 196617 t f f;
#P message 412 610 39 196617 set $1;
#P window linecount 1;
#P newex 529 535 27 196617 + 1.;
#N vpatcher 85 628 423 795;
#P window setfont Geneva 9.;
#P newex 12 94 34 196617 * -1.;
#P inlet 12 34 15 0;
#P inlet 169 34 15 0;
#P outlet 169 125 15 0;
#P newex 169 90 139 196617 if $f1 < ($f2 * -1.) then $f2;
#P newex 12 68 167 196617 if $f1 > $f2 then $f2 else out2 $f1;
#P connect 4 0 0 0;
#P connect 0 0 5 0;
#P connect 3 0 0 1;
#P connect 0 1 1 0;
#P connect 1 0 2 0;
#P fasten 5 0 2 0 17 118 174 118;
#P connect 3 0 1 1;
#P pop;
#P newobj 486 561 53 196617 p wrap_y;
#B color 12;
#N vpatcher 10 59 348 253;
#P inlet 12 34 15 0;
#P inlet 204 34 15 0;
#P outlet 204 154 15 0;
#P window setfont Geneva 9.;
#P newex 204 112 34 196617 * -1.;
#P newex 204 90 104 196617 if $f1 > $f2 then $f2;
#P newex 12 68 202 196617 if $f1 < ($f2 * -1.) then $f2 else out2 $f1;
#P connect 5 0 0 0;
#P connect 4 0 0 1;
#P connect 0 1 1 0;
#P connect 1 0 2 0;
#P connect 2 0 3 0;
#P fasten 0 0 3 0 17 139 209 139;
#P connect 4 0 1 1;
#P pop;
#P newobj 395 561 53 196617 p wrap_x;
#B color 12;
#P newex 535 503 76 196617 unpack 0. 0. 0.;
#P newex 438 535 27 196617 + 0.;
#P newex 443 102 43 196617 % 360.;
#P toggle 107 364 15 0;
#P newex 438 479 205 196617 route dest_dim scale;
#P message 107 411 42 196617 getstate;
#P newex 107 387 63 196617 qmetro 500;
#P newex 438 503 80 196617 expr ($f1/$f2);
#P newex 472 384 149 196617 expr ($f1 * 180.) / 3.141593;
#P newex 373 411 109 196617 pak rotatexyz 0. 0. 0.;
#P inlet 210 131 15 0;
#P inlet 443 32 15 0;
#P inlet 279 32 15 0;
#P window linecount 3;
#P comment 595 149 209 196617 < --this converts degrees into radians and makes for a clockwise rotation (if 3.141593 were positive it would be counterclockwise);
#P window linecount 2;
#P comment 522 79 128 196617 < --this rotates 0 degrees to be pointing straight up;
#P flonum 443 126 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P flonum 443 56 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P window linecount 1;
#P newex 443 79 76 196617 expr $f1 – 90.;
#P comment 24 82 254 196617 change 2nd & 3rd args. to adjust speed in gl space –>;
#P comment 315 56 94 196617 speed forw/backw;
#P flonum 368 333 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P newex 279 106 53 196617 t b f b f;
#P flonum 253 333 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P newex 180 411 102 196617 pak position 0. 0. 0.;
#P window linecount 2;
#P newex 180 442 381 196617 jit.gl.gridshape test @shape sphere @dim 10 10 @scale 0.1 0.1 0.1 @blend_enable 1 @lighting_enable 1 @depth_enable 1 @transform_reset 1 @color 1. 0. 0. 1.;
#P window linecount 1;
#P comment 478 176 43 196617 radians;
#P flonum 443 176 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P newex 443 150 151 196617 expr ($f1 /180.) * -3.141593;
#P newex 279 80 127 196617 scale -10. 10. -0.01 0.01;
#P newex 323 354 40 196617 line 0.;
#P message 323 333 37 196617 $1 10;
#P newex 210 354 40 196617 line 0.;
#P newex 357 274 29 196617 * 0.;
#P newex 244 273 29 196617 * 0.;
#P window linecount 2;
#P comment 370 300 53 196617 speed on z axis;
#P window linecount 1;
#P newex 357 250 21 196617 sin;
#P newex 323 273 27 196617 t f f;
#P newex 323 250 27 196617 f 0.;
#P newex 340 305 27 196617 + 0.;
#P newex 210 197 30 196617 t b b;
#P newex 244 250 23 196617 cos;
#P newex 210 273 27 196617 t f f;
#P toggle 210 155 15 0;
#P newex 210 250 27 196617 f 0.;
#P newex 227 305 27 196617 + 0.;
#P newex 210 176 57 196617 qmetro 10;
#P window linecount 2;
#P comment 257 300 55 196617 speed on x axis;
#P window linecount 1;
#P message 210 333 37 196617 $1 10;
#P flonum 279 56 35 9 -10. 10. 3 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P comment 480 56 45 196617 degrees;
#P connect 61 0 60 0;
#P fasten 26 0 60 1 185 438 64 438;
#P lcolor 15;
#P fasten 37 0 60 2 284 52 98 52;
#P hidden connect 57 0 46 0;
#P connect 46 0 43 0;
#P connect 43 0 44 0;
#P connect 26 0 25 0;
#P fasten 40 0 25 0 378 435 185 435;
#P fasten 44 0 25 0 112 435 185 435;
#P connect 39 0 7 0;
#P connect 7 0 4 0;
#P connect 4 0 10 0;
#P connect 10 0 6 0;
#P connect 6 0 8 0;
#P connect 8 0 2 0;
#P connect 2 0 18 0;
#P connect 53 0 18 0;
#P lcolor 4;
#P connect 18 0 58 0;
#P connect 58 0 26 1;
#P fasten 5 0 6 1 232 327 316 327 316 237 232 237;
#P connect 54 0 6 1;
#P lcolor 4;
#P connect 8 1 5 0;
#P fasten 59 0 26 2 328 403 245 403;
#P connect 23 0 9 0;
#P lcolor 13;
#P connect 28 0 9 0;
#P lcolor 7;
#P connect 9 0 16 0;
#P connect 16 0 5 1;
#P connect 5 0 27 0;
#P connect 28 1 16 1;
#P lcolor 7;
#P connect 37 0 1 0;
#P connect 1 0 21 0;
#P connect 21 0 28 0;
#P fasten 10 1 12 0 235 232 328 232;
#P connect 12 0 13 0;
#P connect 13 0 19 0;
#P connect 19 0 20 0;
#P connect 55 0 20 0;
#P lcolor 4;
#P connect 20 0 59 0;
#P fasten 11 0 12 1 345 328 428 328 428 236 345 236;
#P connect 56 0 12 1;
#P lcolor 4;
#P connect 13 1 11 0;
#P connect 23 0 14 0;
#P lcolor 13;
#P connect 28 2 14 0;
#P lcolor 7;
#P connect 14 0 17 0;
#P connect 17 0 11 1;
#P connect 11 0 29 0;
#P connect 28 3 17 1;
#P lcolor 7;
#P connect 58 1 50 0;
#P connect 50 0 54 0;
#P connect 54 1 53 0;
#P fasten 25 1 45 0 556 475 443 475;
#P connect 45 0 42 0;
#P connect 42 0 48 0;
#P connect 48 0 50 1;
#P connect 38 0 33 0;
#P connect 33 0 32 0;
#P connect 32 0 47 0;
#P connect 47 0 34 0;
#P connect 34 0 22 0;
#P connect 22 0 23 0;
#P fasten 49 0 48 1 540 524 460 524;
#P connect 23 0 41 0;
#P lcolor 13;
#P connect 41 0 40 3;
#P connect 59 1 51 0;
#P connect 51 0 56 0;
#P connect 56 1 55 0;
#P fasten 49 1 52 0 573 529 534 529;
#P connect 52 0 51 1;
#P connect 45 1 49 0;
#P pop;
#P newobj 263 232 126 196617 p your_solution;
#B color 12;
#P window setfont "Sans Serif" 9.;
#P newex 14 85 43 131137545 jit.qball;
#P number 59 36 35 9 0 0 0 2001 0 0 0 221 221 221 222 222 222 0 0 0;
#P toggle 14 36 15 0;
#P newex 14 62 55 131137545 metro 20;
#P newex 14 116 47 131137545 t b erase;
#P toggle 98 187 15 0;
#P newex 59 186 35 131137545 sel 27;
#P message 98 205 68 131137545 fullscreen $1;
#P newex 16 229 135 131137545 jit.window test @depthbuffer 1;
#P newex 14 186 40 131137545 key;
#P newex 14 162 254 131137545 jit.gl.render test @erase_color 0. 0. 0. 1. @camera 0. 0. 4.;
#P window setfont Geneva 9.;
#P comment 251 25 231 196617 a modified version of my glNavigator abstraction;
#P connect 9 0 8 0;
#P connect 8 0 11 0;
#P connect 11 0 7 0;
#P connect 7 1 1 0;
#P connect 7 0 1 0;
#P fasten 4 0 3 0 103 224 21 224;
#P connect 10 0 8 1;
#P fasten 2 0 5 0 19 205 56 205 56 184 64 184;
#P fasten 5 0 6 0 64 204 95 204 95 184 103 184;
#P connect 6 0 4 0;
#P connect 17 0 12 0;
#P connect 14 0 12 1;
#P hidden connect 19 0 13 0;
#P connect 13 0 12 2;
#P pop;


August 23, 2007 | 7:08 am

It won’t move for some reason?

J.


August 23, 2007 | 2:26 pm

There are some loadbangs and loadmesses inside the p yoursolution subpatch. Easiest way is to save the patch, close it, then reopen it. Tell me if you still can’t get it to work after that.


August 23, 2007 | 2:29 pm

Here are both versions zipped up. I slightly altered the jit.gl.sketch version after posting it.


August 26, 2007 | 4:01 pm

Well, I have managed to get the erase_color to work and now have trails! I have had a re-think about making the object come on the other side of the screen to which it went off. I think, using that zooming function on the camera would be cool.

When the object reaches within a certain distance of any of the edges, the camera will zoom out a little. This way, the object will never move off the edge of the screen. Just have to figure out how to relay it’s x,y coords in order to + an amount onto the camera zoom box if that makes sense.

J.


August 26, 2007 | 5:57 pm

Look inside the p zoom subpatch in this new version. You can fine tune it.

max v2;
#N vpatcher 608 317 1109 599;
#P window setfont Geneva 9.;
#P hidden newex 208 41 63 196617 loadmess 0.;
#P comment 75 76 52 196617 turn it on;
#P toggle 92 91 15 0;
#P window linecount 2;
#P comment 207 65 58 196617 rotation mod 360;
#P comment 145 65 50 196617 speed 10. to 10.;
#P flonum 150 92 35 9 -10. 10. 3 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P flonum 208 92 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P window linecount 1;
#N vpatcher 511 169 1338 741;
#P outlet 307 518 15 0;
#P window setfont "Sans Serif" 9.;
#P window linecount 0;
#P message 25 431 31 131137545 reset;
#P window setfont Geneva 9.;
#N vpatcher 71 371 480 661;
#P window setfont Geneva 9.;
#P window linecount 1;
#P newex 106 193 44 196617 qlim 70;
#P newex 106 122 52 196617 change 0.;
#P newex 106 143 44 196617 t b f;
#P window linecount 0;
#P newex 51 122 52 196617 change 0.;
#P inlet 106 93 15 0;
#P inlet 25 94 15 0;
#P newex 265 122 100 196617 expr abs($f1) / 10.;
#P inlet 265 98 15 0;
#P inlet 51 94 15 0;
#P newex 106 172 113 196617 pack 0. 0. 0. 0.;
#P window setfont "Sans Serif" 9.;
#P message 106 216 131 131137545 glcolor 0.5 $4 $3 , point $1 $2;
#P window setfont Geneva 9.;
#P newex 174 25 48 196617 loadbang;
#P newex 174 122 40 196617 line 0.;
#P newex 174 98 69 196617 pack 0. 2000;
#P newex 174 73 40 196617 / 100.;
#P newex 174 50 64 196617 random 100;
#P window setfont "Sans Serif" 9.;
#P message 14 75 31 131137545 reset;
#P window setfont Geneva 9.;
#P newex 106 240 167 196617 jit.gl.sketch test @color 1. 0. 0. 1.;
#P connect 9 0 14 0;
#P connect 13 0 16 0;
#P connect 16 0 15 0;
#P fasten 14 0 8 0 56 167 111 167;
#P connect 15 0 8 0;
#P connect 8 0 17 0;
#P connect 17 0 7 0;
#P connect 7 0 0 0;
#P fasten 1 0 0 0 19 235 111 235;
#P fasten 12 0 0 0 30 235 111 235;
#P connect 15 1 8 1;
#P connect 6 0 2 0;
#P fasten 5 1 2 0 209 145 247 145 247 45 179 45;
#P connect 2 0 3 0;
#P connect 3 0 4 0;
#P connect 4 0 5 0;
#P connect 5 0 8 2;
#P fasten 11 0 8 3 270 155 213 155;
#P connect 10 0 11 0;
#P pop;
#P newobj 25 454 78 196617 p trail;
#B color 12;
#P newex 323 378 40 196617 t f f f;
#P newex 195 378 40 196617 t f f f;
#P window linecount 1;
#N vpatcher 796 297 1183 603;
#P window setfont Geneva 9.;
#P newex 314 51 37 196617 abs 0.;
#P window linecount 0;
#P newex 90 52 37 196617 abs 0.;
#P flonum 314 78 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P flonum 90 78 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P window linecount 1;
#P newex 7 237 93 196617 pak lens_angle 45.;
#P window linecount 0;
#P message 90 186 49 196617 $1 1000;
#P window linecount 1;
#P newex 90 211 40 196617 line 0.;
#P newex 90 159 52 196617 change 0.;
#P newex 90 100 234 196617 if $f1 < = 1.5 && $f2 < 1.5 then 45. else out2 90.;
#P inlet 90 27 15 0;
#P inlet 314 27 15 0;
#P outlet 7 267 15 0;
#P connect 7 0 0 0;
#P connect 2 0 10 0;
#P connect 10 0 8 0;
#P connect 8 0 3 0;
#P fasten 3 1 4 0 319 138 95 138;
#P connect 3 0 4 0;
#P connect 4 0 6 0;
#P connect 6 0 5 0;
#P connect 5 0 7 1;
#P connect 1 0 11 0;
#P connect 11 0 9 0;
#P connect 9 0 3 1;
#P pop;
#P newobj 307 491 41 196617 p zoom;
#B color 12;
#P newex 443 102 43 196617 % 360.;
#P newex 472 384 149 196617 expr ($f1 * 180.) / 3.141593;
#P newex 373 411 109 196617 pak rotatexyz 0. 0. 0.;
#P inlet 195 131 15 0;
#P inlet 443 32 15 0;
#P inlet 279 32 15 0;
#P window linecount 3;
#P comment 595 149 209 196617 < --this converts degrees into radians and makes for a clockwise rotation (if 3.141593 were positive it would be counterclockwise);
#P window linecount 2;
#P comment 522 79 128 196617 < --this rotates 0 degrees to be pointing straight up;
#P flonum 443 126 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P flonum 443 56 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P window linecount 1;
#P newex 443 79 76 196617 expr $f1 – 90.;
#P comment 24 82 254 196617 change 2nd & 3rd args. to adjust speed in gl space –>;
#P comment 315 56 94 196617 speed forw/backw;
#P flonum 368 333 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P newex 279 106 53 196617 t b f b f;
#P flonum 238 333 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P newex 180 411 102 196617 pak position 0. 0. 0.;
#P window linecount 2;
#P newex 180 442 331 196617 jit.gl.gridshape test @shape sphere @dim 10 10 @scale 0.1 0.1 0.1 @blend_enable 1 @lighting_enable 1 @depth_enable 1 @color 1. 0. 0. 1.;
#P window linecount 1;
#P comment 478 176 43 196617 radians;
#P flonum 443 176 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P newex 443 150 151 196617 expr ($f1 /180.) * -3.141593;
#P newex 279 80 127 196617 scale -10. 10. -0.01 0.01;
#P newex 323 354 40 196617 line 0.;
#P message 323 333 37 196617 $1 10;
#P newex 195 354 40 196617 line 0.;
#P newex 357 274 29 196617 * 0.;
#P newex 229 273 29 196617 * 0.;
#P window linecount 2;
#P comment 370 300 53 196617 speed on z axis;
#P window linecount 1;
#P newex 357 250 21 196617 sin;
#P newex 323 273 27 196617 t f f;
#P newex 323 250 27 196617 f 0.;
#P newex 340 305 27 196617 + 0.;
#P newex 195 197 30 196617 t b b;
#P newex 229 250 23 196617 cos;
#P newex 195 273 27 196617 t f f;
#P toggle 195 155 15 0;
#P newex 195 250 27 196617 f 0.;
#P newex 212 305 27 196617 + 0.;
#P newex 195 176 57 196617 qmetro 10;
#P window linecount 2;
#P comment 242 300 55 196617 speed on x axis;
#P window linecount 1;
#P message 195 333 37 196617 $1 10;
#P flonum 279 56 35 9 -10. 10. 3 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P comment 480 56 45 196617 degrees;
#P connect 47 0 46 0;
#P connect 44 0 46 1;
#P lcolor 15;
#P connect 45 0 46 2;
#P lcolor 15;
#P fasten 37 0 46 3 284 52 96 52;
#P fasten 40 0 25 0 378 435 185 435;
#P connect 26 0 25 0;
#P connect 39 0 7 0;
#P connect 7 0 4 0;
#P connect 4 0 10 0;
#P connect 10 0 6 0;
#P connect 6 0 8 0;
#P connect 8 0 2 0;
#P connect 2 0 18 0;
#P connect 18 0 44 0;
#P connect 44 1 26 1;
#P fasten 5 0 6 1 217 327 301 327 301 237 217 237;
#P connect 8 1 5 0;
#P connect 23 0 9 0;
#P lcolor 13;
#P connect 28 0 9 0;
#P lcolor 7;
#P connect 9 0 16 0;
#P connect 16 0 5 1;
#P connect 5 0 27 0;
#P fasten 45 1 26 2 343 403 245 403;
#P connect 28 1 16 1;
#P lcolor 7;
#P connect 37 0 1 0;
#P connect 1 0 21 0;
#P connect 21 0 28 0;
#P connect 44 2 43 0;
#P connect 43 0 48 0;
#P fasten 10 1 12 0 220 232 328 232;
#P connect 12 0 13 0;
#P connect 13 0 19 0;
#P connect 19 0 20 0;
#P connect 20 0 45 0;
#P connect 45 2 43 1;
#P fasten 11 0 12 1 345 328 428 328 428 236 345 236;
#P connect 13 1 11 0;
#P connect 23 0 14 0;
#P lcolor 13;
#P connect 28 2 14 0;
#P lcolor 7;
#P connect 14 0 17 0;
#P connect 17 0 11 1;
#P connect 11 0 29 0;
#P connect 28 3 17 1;
#P lcolor 7;
#P connect 38 0 33 0;
#P connect 33 0 32 0;
#P connect 32 0 42 0;
#P connect 42 0 34 0;
#P connect 34 0 22 0;
#P connect 22 0 23 0;
#P connect 23 0 41 0;
#P lcolor 13;
#P connect 41 0 40 3;
#P pop;
#P newobj 92 116 126 196617 p your_solution;
#B color 12;
#P window setfont "Sans Serif" 9.;
#P newex 14 85 43 131137545 jit.qball;
#P number 59 36 35 9 0 0 0 2001 0 0 0 221 221 221 222 222 222 0 0 0;
#P toggle 14 36 15 0;
#P newex 14 62 55 131137545 metro 20;
#P newex 14 116 47 131137545 t b erase;
#P toggle 98 187 15 0;
#P newex 59 186 35 131137545 sel 27;
#P message 98 205 68 131137545 fullscreen $1;
#P newex 16 229 225 131137545 jit.window test @depthbuffer 1 @rect 50 50 600 600;
#P newex 14 186 40 131137545 key;
#P newex 14 162 254 131137545 jit.gl.render test @erase_color 0. 0. 0. 1. @camera 0. 0. 4.;
#P window setfont Geneva 9.;
#P comment 251 25 231 196617 a modified version of my glNavigator abstraction;
#P connect 9 0 8 0;
#P connect 8 0 11 0;
#P connect 11 0 7 0;
#P fasten 12 0 1 0 97 147 19 147;
#P fasten 7 1 1 0 56 147 19 147;
#P connect 7 0 1 0;
#P fasten 4 0 3 0 103 224 21 224;
#P connect 10 0 8 1;
#P fasten 2 0 5 0 19 205 56 205 56 184 64 184;
#P connect 17 0 12 0;
#P fasten 5 0 6 0 64 204 95 204 95 184 103 184;
#P connect 6 0 4 0;
#P connect 14 0 12 1;
#P hidden connect 19 0 13 0;
#P connect 13 0 12 2;
#P pop;


August 28, 2007 | 2:06 pm

Thats cool, the only problem is that it zooms out only once. When the object hits the edge of the screen again the object then goes off the edge. I need it to pan out again and again.

The other thing is, I don’t want the camera to pan back IN ever. What section of that sub patch do I need to alter that?

I have also been trying to get it to draw two objects, one under the other. I white object (very small) and a blue on top(larger). Using the erase_color function…

#P toggle 581 54 15 0;
#P window setfont "Fixedwidth Serif" 10.;
#P window linecount 1;
#P message 581 75 98 1441802 antialias $1;
#P toggle 469 54 15 0;
#P message 469 75 98 1441802 blend_enable $1;
#P window setfont "Sans Serif" 9.;
#P hidden newex 505 202 63 196617 loadmess 0.;
#P comment 372 237 52 196617 turn it on;
#P toggle 389 252 15 0;
#P window linecount 2;
#P comment 504 226 58 196617 rotation mod 360;
#P comment 442 226 50 196617 speed 10. to 10.;
#P flonum 445 261 35 9 -10. 10. 3 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P flonum 505 253 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P flonum 189 101 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P window linecount 1;
#P newex 102 123 97 196617 pak camera 0. 0. 4.;
#N vpatcher 347 196 1192 681;
#P origin 0 5;
#P window setfont "Sans Serif" 9.;
#P window linecount 0;
#P newex 592 188 45 196617 loadbang;
#P message 583 218 17 196617 1.;
#P window setfont "Fixedwidth Serif" 10.;
#P newex 483 255 136 1441802 pak color 0. 0. 0. 1.;
#B color 5;
#P inlet 210 126 15 0;
#P inlet 443 27 15 0;
#P inlet 279 27 15 0;
#P window setfont "Sans Serif" 9.;
#P window linecount 3;
#P comment 595 125 209 196617 < --this converts degrees into radians and makes for a clockwise rotation (if 3.141593 were positive it would be counterclockwise);
#P window linecount 2;
#P comment 564 75 128 196617 < --this rotates 0 degrees to be pointing straight up;
#P flonum 443 102 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P flonum 443 51 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P window linecount 1;
#P newex 443 74 120 196617 expr ($f1 – 90.) % 360.;
#P comment 24 77 254 196617 change 2nd & 3rd args. to adjust speed in gl space –>;
#P comment 315 51 94 196617 speed forw/backw;
#P flonum 368 328 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P newex 279 101 53 196617 t b f b f;
#P flonum 253 328 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P newex 180 382 102 196617 pak position 0. 0. 0.;
#P newex 183 415 328 196617 jit.gl.gridshape test @shape sphere @scale 0.1 0.1 0.1 @depthbuffer 2;
#P comment 478 152 43 196617 radians;
#P flonum 443 152 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P newex 443 126 151 196617 expr ($f1 /180.) * -3.141593;
#P newex 279 75 127 196617 scale -10. 10. -0.01 0.01;
#P newex 323 349 40 196617 line 0.;
#P message 323 328 37 196617 $1 10;
#P newex 210 349 40 196617 line 0.;
#P newex 357 269 29 196617 * 0.;
#P newex 244 268 29 196617 * 0.;
#P window linecount 2;
#P comment 370 295 53 196617 speed on z axis;
#P window linecount 1;
#P newex 357 245 21 196617 sin;
#P newex 323 268 27 196617 t f f;
#P newex 323 245 27 196617 f 0.;
#P newex 340 300 27 196617 + 0.;
#P newex 210 192 30 196617 t b b;
#P newex 244 245 23 196617 cos;
#P newex 210 268 27 196617 t f f;
#P toggle 210 150 15 0;
#P newex 210 245 27 196617 f 0.;
#P newex 227 300 27 196617 + 0.;
#P newex 210 171 57 196617 qmetro 10;
#P window linecount 2;
#P comment 257 295 55 196617 speed on x axis;
#P window linecount 1;
#P message 210 328 37 196617 $1 10;
#P flonum 279 51 35 9 -10. 10. 3 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P comment 480 51 45 196617 degrees;
#P connect 40 0 25 0;
#P connect 26 0 25 0;
#P connect 39 0 7 0;
#P connect 7 0 4 0;
#P connect 4 0 10 0;
#P connect 10 0 6 0;
#P connect 6 0 8 0;
#P connect 8 0 2 0;
#P connect 2 0 18 0;
#P connect 18 0 26 1;
#P fasten 5 0 6 1 232 322 316 322 316 232 232 232;
#P connect 8 1 5 0;
#P fasten 20 0 26 2 328 374 245 374;
#P connect 23 0 9 0;
#P lcolor 13;
#P connect 28 0 9 0;
#P lcolor 7;
#P connect 9 0 16 0;
#P connect 16 0 5 1;
#P connect 5 0 27 0;
#P connect 28 1 16 1;
#P lcolor 7;
#P connect 37 0 1 0;
#P connect 1 0 21 0;
#P connect 21 0 28 0;
#P fasten 10 1 12 0 235 227 328 227;
#P connect 12 0 13 0;
#P connect 13 0 19 0;
#P connect 19 0 20 0;
#P fasten 11 0 12 1 345 323 428 323 428 231 345 231;
#P connect 13 1 11 0;
#P connect 23 0 14 0;
#P lcolor 13;
#P connect 28 2 14 0;
#P lcolor 7;
#P connect 14 0 17 0;
#P connect 17 0 11 1;
#P connect 11 0 29 0;
#P connect 28 3 17 1;
#P lcolor 7;
#P connect 38 0 33 0;
#P connect 33 0 32 0;
#P connect 32 0 34 0;
#P connect 34 0 22 0;
#P connect 22 0 23 0;
#P connect 41 0 40 3;
#P connect 42 0 41 0;
#P pop;
#P newobj 417 318 51 196617 p blueDot;
#B color 12;
#P newex 21 92 43 196617 jit.qball;
#P number 66 43 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P toggle 21 43 15 0;
#P newex 21 69 55 196617 metro 20;
#P newex 21 123 47 196617 t b erase;
#P toggle 105 194 15 0;
#P newex 66 193 35 196617 sel 27;
#P message 105 212 68 196617 fullscreen $1;
#P newex 23 236 159 196617 jit.window test @depthbuffer 1;
#P newex 21 193 40 196617 key;
#P newex 18 164 291 196617 jit.gl.render test @erase_color 0. 0. 0. 0.04 @camera 0. 0. 4.;
#P window linecount 2;
#P comment 188 73 257 196617 move camera "back" (i.e. higher numbers) if you want to have more viewable distance on the x and y axes;
#P window linecount 1;
#P comment 258 32 231 196617 a modified version of my glNavigator abstraction;
#N vpatcher 347 196 1192 681;
#P origin 0 5;
#P window setfont "Sans Serif" 9.;
#P window linecount 0;
#P newex 592 188 45 196617 loadbang;
#P message 583 218 17 196617 1.;
#P window setfont "Fixedwidth Serif" 10.;
#P newex 483 255 136 1441802 pak color 0. 0. 0. 1.;
#B color 5;
#P inlet 210 126 15 0;
#P inlet 443 27 15 0;
#P inlet 279 27 15 0;
#P window setfont "Sans Serif" 9.;
#P window linecount 3;
#P comment 595 125 209 196617 < --this converts degrees into radians and makes for a clockwise rotation (if 3.141593 were positive it would be counterclockwise);
#P window linecount 2;
#P comment 564 75 128 196617 < --this rotates 0 degrees to be pointing straight up;
#P flonum 443 102 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P flonum 443 51 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P window linecount 1;
#P newex 443 74 120 196617 expr ($f1 – 90.) % 360.;
#P comment 24 77 254 196617 change 2nd & 3rd args. to adjust speed in gl space –>;
#P comment 315 51 94 196617 speed forw/backw;
#P flonum 368 328 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P newex 279 101 53 196617 t b f b f;
#P flonum 253 328 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P newex 180 382 102 196617 pak position 0. 0. 0.;
#P newex 180 413 340 196617 jit.gl.gridshape test @shape sphere @scale 0.05 0.05 0.1 @depthbuffer 3;
#P comment 478 152 43 196617 radians;
#P flonum 443 152 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P newex 443 126 151 196617 expr ($f1 /180.) * -3.141593;
#P newex 279 75 127 196617 scale -10. 10. -0.01 0.01;
#P newex 323 349 40 196617 line 0.;
#P message 323 328 37 196617 $1 10;
#P newex 210 349 40 196617 line 0.;
#P newex 357 269 29 196617 * 0.;
#P newex 244 268 29 196617 * 0.;
#P window linecount 2;
#P comment 370 295 53 196617 speed on z axis;
#P window linecount 1;
#P newex 357 245 21 196617 sin;
#P newex 323 268 27 196617 t f f;
#P newex 323 245 27 196617 f 0.;
#P newex 340 300 27 196617 + 0.;
#P newex 210 192 30 196617 t b b;
#P newex 244 245 23 196617 cos;
#P newex 210 268 27 196617 t f f;
#P toggle 210 150 15 0;
#P newex 210 245 27 196617 f 0.;
#P newex 227 300 27 196617 + 0.;
#P newex 210 171 57 196617 qmetro 10;
#P window linecount 2;
#P comment 257 295 55 196617 speed on x axis;
#P window linecount 1;
#P message 210 328 37 196617 $1 10;
#P flonum 279 51 35 9 -10. 10. 3 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P comment 480 51 45 196617 degrees;
#P connect 26 0 25 0;
#P connect 40 0 25 0;
#P connect 39 0 7 0;
#P connect 7 0 4 0;
#P connect 4 0 10 0;
#P connect 10 0 6 0;
#P connect 6 0 8 0;
#P connect 8 0 2 0;
#P connect 2 0 18 0;
#P connect 18 0 26 1;
#P fasten 5 0 6 1 232 322 316 322 316 232 232 232;
#P connect 8 1 5 0;
#P fasten 20 0 26 2 328 374 245 374;
#P connect 23 0 9 0;
#P lcolor 13;
#P connect 28 0 9 0;
#P lcolor 7;
#P connect 9 0 16 0;
#P connect 16 0 5 1;
#P connect 5 0 27 0;
#P connect 28 1 16 1;
#P lcolor 7;
#P connect 37 0 1 0;
#P connect 1 0 21 0;
#P connect 21 0 28 0;
#P fasten 10 1 12 0 235 227 328 227;
#P connect 12 0 13 0;
#P connect 13 0 19 0;
#P connect 19 0 20 0;
#P fasten 11 0 12 1 345 323 428 323 428 231 345 231;
#P connect 13 1 11 0;
#P connect 23 0 14 0;
#P lcolor 13;
#P connect 28 2 14 0;
#P lcolor 7;
#P connect 14 0 17 0;
#P connect 17 0 11 1;
#P connect 11 0 29 0;
#P connect 28 3 17 1;
#P lcolor 7;
#P connect 38 0 33 0;
#P connect 33 0 32 0;
#P connect 32 0 34 0;
#P connect 34 0 22 0;
#P connect 22 0 23 0;
#P connect 41 0 40 1;
#P connect 41 0 40 2;
#P connect 41 0 40 3;
#P connect 42 0 41 0;
#P pop;
#P newobj 489 318 58 196617 p whiteDot;
#B color 12;
#P connect 21 0 0 0;
#P connect 21 0 14 0;
#P connect 18 0 0 1;
#P connect 18 0 14 1;
#P connect 17 0 0 2;
#P connect 17 0 14 2;
#P connect 27 0 26 0;
#P hidden connect 23 0 17 0;
#P connect 25 0 24 0;
#P connect 16 0 15 3;
#P connect 8 0 6 0;
#P fasten 7 0 8 0 71 211 102 211 102 191 110 191;
#P fasten 4 0 7 0 26 212 63 212 63 191 71 191;
#P connect 12 0 10 1;
#P fasten 6 0 5 0 110 231 28 231;
#P connect 13 0 9 0;
#P connect 10 0 13 0;
#P connect 11 0 10 0;
#P fasten 15 0 3 0 107 153 23 153;
#P connect 9 0 3 0;
#P fasten 9 1 3 0 63 149 23 149;
#P connect 24 0 3 0;
#P connect 26 0 3 0;
#P window clipboard copycount 28;

The idea is that the white dot is drawn under the blue one. The blue one should leave a fading trail, which works successfully and then the white dot under leaves the permanent white trail (the scale of the white dot is 0.05).

I am having trouble getting it to:
a) draw the white dot under the blue

and

b)the fade applies to what ever is in the test render window, i don’t know how to separate it so I can have a value of 0.04 on the blue dot’s alpha and a value of 0 on the white dots alpha (in the @erase_color attribute) since it has to be added to the jit.render message box.

J.


August 28, 2007 | 3:14 pm

As I said before, looking inside the p zoom subpatch. I’m modifying the lens_angle to zoom in and out. You should take a look at it and modify it to your liking. It’s easy to eliminate zooming back in – adjust the appropriate if objects.

As for rendering one object below another, give them different layer attributes. Give the little white dot a @layer 0 and the balloon @layer 1. The balloon will be on top then.

As for different type of trails simultaneously, you might try applying the jit.gl.sketch that I’ve been giving you to the little white dot, if you want the trail to be permanent.


August 28, 2007 | 3:21 pm

yes, I am playing with the trails patch now. I can’t figure out how to stop it from cycling in colour and just make it white. I modified the qlim to 1 so it appears as a solid line and guessed that the gcolor is what i need to adjust to turn it too white but cant get it to change it.

As far as modifying the p zoom expression, because I am going to run at a resolution of 1024×768 I have upped the initial statement to ‘if $f1 < = 2. && $f2 < 1.5 then 45. else out2 90.' I can't seem to sort out how to prevent the shere from becoming elongated as it moves further to left or right.


August 29, 2007 | 3:56 am

Now the trails are only white. I’ve adjusted the zooming subpatch to zoom out not by using the lens_angle attribute, but by moving out on the z axis. This doesn’t distort the sphere. Look inside the ‘p ifs’ subpatch inside the ‘p zoom’ subpatch to see how I’m doing it. It only zooms out. Never zooms back in. I’m sure you can take it from here. I’ve pretty much given you everything you need. Spend some time figuring out what’s going on.

Here it is:

max v2;
#N vpatcher 608 317 1109 599;
#P window setfont Geneva 9.;
#P hidden newex 208 41 63 196617 loadmess 0.;
#P comment 75 76 52 196617 turn it on;
#P toggle 92 91 15 0;
#P window linecount 2;
#P comment 207 65 58 196617 rotation mod 360;
#P comment 145 65 50 196617 speed 10. to 10.;
#P flonum 150 92 35 9 -10. 10. 3 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P flonum 208 92 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P window linecount 1;
#N vpatcher 511 169 1338 741;
#P outlet 307 518 15 0;
#P window setfont "Sans Serif" 9.;
#P window linecount 0;
#P message 25 431 31 131137545 reset;
#P window setfont Geneva 9.;
#N vpatcher 71 371 376 616;
#P window setfont Geneva 9.;
#P window linecount 1;
#P newex 106 146 44 196617 qlim 10;
#P newex 106 75 52 196617 change 0.;
#P newex 106 96 54 196617 t b f;
#P window linecount 0;
#P newex 51 75 52 196617 change 0.;
#P inlet 106 46 15 0;
#P inlet 25 47 15 0;
#P inlet 51 47 15 0;
#P newex 106 125 54 196617 pack 0. 0.;
#P window setfont "Sans Serif" 9.;
#P message 106 169 122 131137545 glcolor 1. 1. 1. , point $1 $2;
#P message 14 28 31 131137545 reset;
#P window setfont Geneva 9.;
#P newex 106 193 167 196617 jit.gl.sketch test @color 1. 0. 0. 1.;
#P connect 4 0 7 0;
#P connect 6 0 9 0;
#P connect 9 0 8 0;
#P connect 8 0 3 0;
#P fasten 7 0 3 0 56 120 111 120;
#P connect 3 0 10 0;
#P connect 10 0 2 0;
#P connect 2 0 0 0;
#P fasten 1 0 0 0 19 188 111 188;
#P fasten 5 0 0 0 30 188 111 188;
#P connect 8 1 3 1;
#P pop;
#P newobj 25 454 78 196617 p trail;
#B color 12;
#P newex 323 378 40 196617 t f f f;
#P newex 195 378 40 196617 t f f f;
#P window linecount 1;
#N vpatcher 642 203 882 494;
#P window setfont Geneva 9.;
#N vpatcher 10 59 397 356;
#P window setfont Geneva 9.;
#P window linecount 2;
#P comment 97 229 226 196617 the change objects allows for each "zoom out" to happen only once. There is no zooming back in;
#P window linecount 1;
#P newex 85 194 40 196617 change;
#P newex 66 141 40 196617 change;
#P window linecount 0;
#P newex 37 91 40 196617 change;
#P outlet 37 229 15 0;
#P inlet 256 38 15 0;
#P inlet 37 38 15 0;
#P window linecount 1;
#P newex 85 172 235 196617 if $f1 < = 4.5 && $f2 < 4.5 then 12. else out2 $f1;
#P newex 66 119 217 196617 if $f1 < = 3. && $f2 < 3. then 8. else out2 $f1;
#P newex 37 62 229 196617 if $f1 < = 1.5 && $f2 < 1.5 then 4. else out2 $f1;
#P window linecount 0;
#P comment 305 194 60 196617 add more…;
#P connect 4 0 1 0;
#P connect 1 0 7 0;
#P connect 7 0 6 0;
#P fasten 8 0 6 0 71 193 42 193;
#P fasten 9 0 6 0 90 220 42 220;
#P fasten 1 1 2 0 261 114 71 114;
#P connect 2 0 8 0;
#P fasten 2 1 3 0 278 166 90 166;
#P connect 3 0 9 0;
#P connect 5 0 1 1;
#P fasten 5 0 2 1 261 60 278 60;
#P fasten 5 0 3 1 261 59 315 59;
#P pop;
#P newobj 90 113 81 196617 p ifs;
#B color 12;
#P window linecount 0;
#P newex 161 51 37 196617 abs 0.;
#P newex 90 52 37 196617 abs 0.;
#P flonum 161 78 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P flonum 90 78 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P window linecount 1;
#P newex 9 218 93 196617 pak camera 0. 0. 4.;
#P window linecount 0;
#P message 90 167 49 196617 $1 1000;
#P window linecount 1;
#P newex 90 192 40 196617 line 0.;
#P newex 90 140 52 196617 change 0.;
#P inlet 90 27 15 0;
#P inlet 161 27 15 0;
#P outlet 9 248 15 0;
#P connect 6 0 0 0;
#P connect 2 0 9 0;
#P connect 9 0 7 0;
#P connect 7 0 11 0;
#P connect 11 0 3 0;
#P connect 3 0 5 0;
#P connect 5 0 4 0;
#P connect 4 0 6 3;
#P connect 1 0 10 0;
#P connect 10 0 8 0;
#P connect 8 0 11 1;
#P pop;
#P newobj 307 491 41 196617 p zoom;
#B color 12;
#P newex 443 102 43 196617 % 360.;
#P newex 472 384 149 196617 expr ($f1 * 180.) / 3.141593;
#P newex 373 411 109 196617 pak rotatexyz 0. 0. 0.;
#P inlet 195 131 15 0;
#P inlet 443 32 15 0;
#P inlet 279 32 15 0;
#P window linecount 3;
#P comment 595 149 209 196617 < --this converts degrees into radians and makes for a clockwise rotation (if 3.141593 were positive it would be counterclockwise);
#P window linecount 2;
#P comment 522 79 128 196617 < --this rotates 0 degrees to be pointing straight up;
#P flonum 443 126 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P flonum 443 56 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P window linecount 1;
#P newex 443 79 76 196617 expr $f1 – 90.;
#P comment 24 82 254 196617 change 2nd & 3rd args. to adjust speed in gl space –>;
#P comment 315 56 94 196617 speed forw/backw;
#P flonum 368 333 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P newex 279 106 53 196617 t b f b f;
#P flonum 238 333 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P newex 180 411 102 196617 pak position 0. 0. 0.;
#P window linecount 2;
#P newex 180 442 331 196617 jit.gl.gridshape test @shape sphere @dim 10 10 @scale 0.1 0.1 0.1 @blend_enable 1 @lighting_enable 1 @depth_enable 1 @color 1. 0. 0. 1.;
#P window linecount 1;
#P comment 478 176 43 196617 radians;
#P flonum 443 176 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P newex 443 150 151 196617 expr ($f1 /180.) * -3.141593;
#P newex 279 80 127 196617 scale -10. 10. -0.01 0.01;
#P newex 323 354 40 196617 line 0.;
#P message 323 333 37 196617 $1 10;
#P newex 195 354 40 196617 line 0.;
#P newex 357 274 29 196617 * 0.;
#P newex 229 273 29 196617 * 0.;
#P window linecount 2;
#P comment 370 300 53 196617 speed on z axis;
#P window linecount 1;
#P newex 357 250 21 196617 sin;
#P newex 323 273 27 196617 t f f;
#P newex 323 250 27 196617 f 0.;
#P newex 340 305 27 196617 + 0.;
#P newex 195 197 30 196617 t b b;
#P newex 229 250 23 196617 cos;
#P newex 195 273 27 196617 t f f;
#P toggle 195 155 15 0;
#P newex 195 250 27 196617 f 0.;
#P newex 212 305 27 196617 + 0.;
#P newex 195 176 57 196617 qmetro 10;
#P window linecount 2;
#P comment 242 300 55 196617 speed on x axis;
#P window linecount 1;
#P message 195 333 37 196617 $1 10;
#P flonum 279 56 35 9 -10. 10. 3 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P comment 480 56 45 196617 degrees;
#P connect 47 0 46 0;
#P connect 44 0 46 1;
#P lcolor 15;
#P connect 45 0 46 2;
#P lcolor 15;
#P fasten 40 0 25 0 378 435 185 435;
#P connect 26 0 25 0;
#P connect 39 0 7 0;
#P connect 7 0 4 0;
#P connect 4 0 10 0;
#P connect 10 0 6 0;
#P connect 6 0 8 0;
#P connect 8 0 2 0;
#P connect 2 0 18 0;
#P connect 18 0 44 0;
#P connect 44 1 26 1;
#P fasten 5 0 6 1 217 327 301 327 301 237 217 237;
#P connect 8 1 5 0;
#P connect 23 0 9 0;
#P lcolor 13;
#P connect 28 0 9 0;
#P lcolor 7;
#P connect 9 0 16 0;
#P connect 16 0 5 1;
#P connect 5 0 27 0;
#P fasten 45 1 26 2 343 403 245 403;
#P connect 28 1 16 1;
#P lcolor 7;
#P connect 37 0 1 0;
#P connect 1 0 21 0;
#P connect 21 0 28 0;
#P connect 44 2 43 0;
#P connect 43 0 48 0;
#P fasten 10 1 12 0 220 232 328 232;
#P connect 12 0 13 0;
#P connect 13 0 19 0;
#P connect 19 0 20 0;
#P connect 20 0 45 0;
#P connect 45 2 43 1;
#P fasten 11 0 12 1 345 328 428 328 428 236 345 236;
#P connect 13 1 11 0;
#P connect 23 0 14 0;
#P lcolor 13;
#P connect 28 2 14 0;
#P lcolor 7;
#P connect 14 0 17 0;
#P connect 17 0 11 1;
#P connect 11 0 29 0;
#P connect 28 3 17 1;
#P lcolor 7;
#P connect 38 0 33 0;
#P connect 33 0 32 0;
#P connect 32 0 42 0;
#P connect 42 0 34 0;
#P connect 34 0 22 0;
#P connect 22 0 23 0;
#P connect 23 0 41 0;
#P lcolor 13;
#P connect 41 0 40 3;
#P pop;
#P newobj 92 116 126 196617 p your_solution;
#B color 12;
#P window setfont "Sans Serif" 9.;
#P newex 14 85 43 131137545 jit.qball;
#P number 59 36 35 9 0 0 0 2001 0 0 0 221 221 221 222 222 222 0 0 0;
#P toggle 14 36 15 0;
#P newex 14 62 55 131137545 metro 20;
#P newex 14 116 47 131137545 t b erase;
#P toggle 98 187 15 0;
#P newex 59 186 35 131137545 sel 27;
#P message 98 205 68 131137545 fullscreen $1;
#P newex 16 229 225 131137545 jit.window test @depthbuffer 1 @rect 50 50 600 600;
#P newex 14 186 40 131137545 key;
#P newex 14 162 254 131137545 jit.gl.render test @erase_color 0. 0. 0. 1. @camera 0. 0. 4.;
#P window setfont Geneva 9.;
#P comment 251 25 231 196617 a modified version of my glNavigator abstraction;
#P connect 9 0 8 0;
#P connect 8 0 11 0;
#P connect 11 0 7 0;
#P fasten 12 0 1 0 97 147 19 147;
#P fasten 7 1 1 0 56 147 19 147;
#P connect 7 0 1 0;
#P fasten 4 0 3 0 103 224 21 224;
#P connect 10 0 8 1;
#P fasten 2 0 5 0 19 205 56 205 56 184 64 184;
#P connect 17 0 12 0;
#P fasten 5 0 6 0 64 204 95 204 95 184 103 184;
#P connect 6 0 4 0;
#P connect 14 0 12 1;
#P hidden connect 19 0 13 0;
#P connect 13 0 12 2;
#P pop;


August 29, 2007 | 5:39 pm

Thanks so much for all of your help, you have been more than generous and I cannot express my appreciation enough. I have learn’t so much from your patches. Thanks also for your patience. I come from a Flash action scripting background so fundamentally, the principles and concepts of modular programming are there for me and now, thanks to you, my knowledge of the ins and outs of max and jitter have been expanded greatly!

I managed to begin sorting out the if statements last night and things but I have had to share my time with building the installation. It’s a mad panic to get it up and i’m pretty exhausted!

Anyhoo, again, many thanks for your help.

J.


Viewing 21 posts - 1 through 21 (of 21 total)