Forums > Jitter

jit.gl.sketch undulation or distortion

April 3, 2007 | 3:54 pm

I’m trying to re-create an effect I created for a dance company. I had initially done it as a pre-rendered movie in After Effects, but now I’m researching if it can be implemented in realtime.

I’ve enclosed an image that shows the effect. The rings (puddles?) move around the screen while the dancers simulate moving the puddles with the poles.

Right now I’m less concerned with the live-tracking aspect than with making the same objects in Jitter. The patch (hacked out of the gl.sketch helpfile) creates the shape – but in the original work the points around the circle undulated a bit in distance from the center. I’m wondering if there’s a way to vary or distort the geometry of the framecircles independently to get this result.

Does Sketch have a way of distorting shapes directly? Any advice on what direction to take?

Thanks in advance…

max v2;
#N vpatcher 316 86 1270 822;
#P origin 0 30;
#P window setfont "Sans Serif" 9.;
#P window linecount 1;
#P message 107 393 37 196617 0.31;
#P newex 87 364 48 196617 loadbang;
#P message 48 495 70 196617 camera 1 1 1;
#P newex 57 297 32 196617 print;
#P flonum 307 129 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P flonum 272 128 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P flonum 237 128 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P flonum 202 128 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P newex 167 180 150 196617 pak rotate 0. 0. 0. 0.;
#P newex 144 443 124 196617 lsub 0. 0.05 0.1 0.15 0.2;
#P toggle 52 196 15 0;
#P message 7 244 78 196617 auto_rotate $1;
#P flonum 144 418 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P window linecount 2;
#P message 167 511 303 196617 glcolor 255 255 255 , shapeslice 10 10 , framecircle $1 , framecircle $2 , framecircle $3 , framecircle $4 , framecircle $5;
#P toggle 718 498 15 0;
#P window linecount 1;
#P message 718 518 59 196617 floating $1;
#P newex 380 403 81 196617 t b b b b b reset;
#P button 318 342 45 0;
#P hidden newex 13 683 103 196617 jit.obref jit.gl.sketch;
#P button 13 658 15 0;
#P comment 29 660 112 196617 • view html reference.;
#P newex 164 326 89 196617 route attributes;
#P newex 164 346 50 196617 iter;
#P message 597 496 75 196617 getattributes;
#P newex 85 263 94 196617 jit.gl.handle puddle;
#P toggle 206 384 15 0;
#P message 206 407 70 196617 displaylist $1;
#P window setfont "Sans Serif" 18.;
#N vpatcher 213 499 658 688;
#P origin 60 40;
#P window setfont "Sans Serif" 9.;
#P window linecount 0;
#P hidden newex 234 136 104 196617 bgcolor 255 230 230;
#P window setfont "Sans Serif" 18.;
#P comment 220 25 189 196626 cmdlist commands;
#P window setfont "Sans Serif" 9.;
#P message 65 29 32 196617 reset;
#P window linecount 6;
#P comment 220 54 194 196617 cmd_delete ; cmd_enable ; cmd_insert ; cmd_replace ; getcmdlist ; reset ;;
#P toggle 95 101 15 0;
#P window linecount 1;
#P message 95 119 109 196617 cmd_enable glcolor $1;
#P toggle 8 101 15 0;
#P message 77 65 93 196617 cmd_delete glcolor;
#P newex 8 142 51 196617 s sketchy;
#P message 8 83 169 196617 cmd_replace 0 moveto 0.2 0.6 -0.7;
#P message 8 119 84 196617 cmd_enable 0 $1;
#P message 8 65 67 196617 cmd_delete 0;
#P message 8 47 140 196617 cmd_insert 0 glcolor 1 0 0 1;
#P message 8 29 55 196617 getcmdlist;
#P connect 7 0 3 0;
#P hidden connect 11 0 5 0;
#P hidden connect 0 0 5 0;
#P hidden connect 1 0 5 0;
#P hidden connect 2 0 5 0;
#P hidden connect 3 0 5 0;
#P hidden connect 4 0 5 0;
#P hidden connect 6 0 5 0;
#P hidden connect 8 0 5 0;
#P connect 9 0 8 0;
#P pop;
#P newobj 559 52 194 196626 p cmdlist_commands;
#N vpatcher 99 453 879 717;
#P origin 49 40;
#P window setfont "Sans Serif" 9.;
#P hidden newex 12 210 104 196617 bgcolor 255 230 230;
#P newex 578 117 156 196617 jit.gl.gridshape nowhere @name squeamish @shape torus;
#P message 579 154 155 196617 glcolor 1 0 0 , glscale 0.2 0.2 0.2 , drawobject squeamish 1 , glrotate 90 0 1 0 , glcolor 0 1 0 , drawobject squeamish 1;
#P newex 466 65 84 196617 prepend shape;
#P user umenu 466 42 85 196647 1 64 58 1;
#X add sphere;
#X add cylinder;
#X add opencylinder;
#X add torus;
#X add circle;
#X add cube;
#X add opencube;
#X add plane;
#P newex 466 164 82 196617 jit.matrix blotto;
#P newex 466 88 255 196617 jit.gl.gridshape nowhere @shape cube @matrixoutput 1;
#P window setfont "Sans Serif" 18.;
#P comment 53 18 162 196626 object commands;
#P button 10 120 15 0;
#P window setfont "Sans Serif" 9.;
#P newex 10 153 127 196617 jit.noise 12 float32 10 10 @out_name blitto;
#P message 190 152 132 196617 drawmatrix blitto tri_strip;
#P newex 190 228 51 196617 s sketchy;
#P comment 54 47 402 196617 drawobject ; drawmatrix

; dimorient <0/1> (affects drawmatrix command. initial state is 0);
#P message 203 192 373 196617 reset , drawmatrix blotto line_strip , dimorient 1 , drawmatrix blotto line_strip;
#P button 410 110 15 0;
#P comment 177 86 185 196617 texflag: 0=use , 1=ignore , 2=auto ; normalflag: 0=use , 1=ignore , 2=auto ; colorflag: 0=use , 1=ignore ; edgeflag: 0=use , 1=ignore;
#P connect 7 0 6 0;
#P fasten 7 0 5 0 15 143 195 143;
#P fasten 13 0 4 0 584 223 195 223;
#P fasten 2 0 4 0 208 221 195 221;
#P connect 5 0 4 0;
#P fasten 1 0 2 0 415 184 208 184;
#P fasten 11 1 12 0 546 62 471 62;
#P fasten 1 0 9 0 415 144 461 144 461 85 471 85;
#P connect 12 0 9 0;
#P connect 9 0 10 0;
#P pop;
#P newobj 559 118 187 196626 p object_commands;
#P user jit.fpsgui 234 660 60 196626 0;
#N vpatcher 288 164 1041 861;
#P origin 49 39;
#P window setfont "Sans Serif" 9.;
#P hidden newex 354 659 104 196617 bgcolor 255 230 230;
#P message 542 29 28 196617 read;
#P window linecount 3;
#P message 618 105 104 196617 gldisable depth_test , gldrawpixels xfer , glenable depth_test;
#P button 523 29 15 0;
#P window linecount 1;
#P newex 523 50 91 196617 jit.qt.movie 80 60;
#P message 619 159 85 196617 glreadpixels xfer;
#P button 633 48 15 0;
#P user jit.pwindow 522 105 82 62 0 1 0 0 1 0;
#P newex 523 75 138 196617 jit.matrix xfer 4 char 80 60;
#P window setfont "Sans Serif" 18.;
#P comment 61 602 218 196626 glu wrapper;
#P comment 380 193 103 196626 gl wrapper;
#P window setfont "Sans Serif" 9.;
#P window linecount 3;
#P comment 61 629 218 196617 glulookat ; gluortho2d ; gluperspective ;;
#P window linecount 1;
#N vpatcher 318 48 1063 814;
#P origin 0 30;
#P window setfont "Sans Serif" 18.;
#P comment 581 425 137 196626 texgen mode;
#P window setfont "Sans Serif" 9.;
#P comment 581 453 119 196617 object_linear ; sphere_map ; eye_linear;
#P comment 437 306 119 196617 modulate ; decal ; blend ; replace;
#P window setfont "Sans Serif" 18.;
#P comment 437 278 142 196626 texenv mode;
#P window setfont "Sans Serif" 9.;
#P hidden newex 408 712 104 196617 bgcolor 255 230 230;
#P comment 439 652 119 196617 nearest ; linear ; clamp ; repeat;
#P window setfont "Sans Serif" 18.;
#P comment 438 624 218 196626 texparameter pvalue;
#P window setfont "Sans Serif" 9.;
#P comment 438 553 119 196617 mag_filter ; min_filter ; wrap_s ; wrap_t ; border_color;
#P window setfont "Sans Serif" 18.;
#P comment 438 525 218 196626 texparameter pname;
#P window setfont "Sans Serif" 9.;
#P comment 438 481 119 196617 texture_gen_mode ; object_plane ; eye_plane;
#P window setfont "Sans Serif" 18.;
#P comment 438 453 137 196626 texgen pname;
#P window setfont "Sans Serif" 9.;
#P comment 438 394 119 196617 s ; t ; r ; q;
#P window setfont "Sans Serif" 18.;
#P comment 438 365 125 196626 texgen coord;
#P window setfont "Sans Serif" 9.;
#P comment 437 246 119 196617 mode ; color;
#P window setfont "Sans Serif" 18.;
#P comment 437 218 119 196626 texenv;
#P window setfont "Sans Serif" 9.;
#P comment 437 187 119 196617 flat ; smooth;
#P window setfont "Sans Serif" 18.;
#P comment 437 159 119 196626 shademodel;
#P window setfont "Sans Serif" 9.;
#P comment 437 51 120 196617 red_scale ; red_bias ; green_scale ; green_bias ; blue_scale ; blue_bias ; alpha_scale ; alpha_bias;
#P window setfont "Sans Serif" 18.;
#P comment 437 23 119 196626 pixeltransfer;
#P window setfont "Sans Serif" 9.;
#P comment 290 687 106 196617 fill 0 ; line 1 ; point 2;
#P window setfont "Sans Serif" 18.;
#P comment 290 659 133 196626 polygonmode;
#P window setfont "Sans Serif" 9.;
#P comment 290 614 106 196617 modelview ; projection ; texture;
#P window setfont "Sans Serif" 18.;
#P comment 290 586 133 196626 matrixmode;
#P window setfont "Sans Serif" 9.;
#P comment 290 122 120 196617 ambient ; diffuse ; specular ; position ; spot_cutoff ; spot_direction ; spot_exponent ; linear_attenuation ; quadratic_attenuation;
#P window setfont "Sans Serif" 18.;
#P comment 290 94 119 196626 lightparam;
#P window setfont "Sans Serif" 9.;
#P comment 290 50 120 196617 ambient ; local_viewer ; two_side;
#P window setfont "Sans Serif" 18.;
#P comment 290 22 119 196626 lightmodel;
#P window setfont "Sans Serif" 9.;
#P comment 167 640 116 196617 perspective_correction ; point_smooth ; line_smooth ; polygon_smooth ; fog;
#P window setfont "Sans Serif" 18.;
#P comment 167 612 117 196626 hint target;
#P window setfont "Sans Serif" 9.;
#P comment 30 673 101 196617 dont_care ; nicest ; fastest;
#P window setfont "Sans Serif" 18.;
#P comment 30 645 100 196626 hint mode;
#P window setfont "Sans Serif" 9.;
#P comment 30 600 101 196617 linear ; exp ; exp2;
#P window setfont "Sans Serif" 18.;
#P comment 30 572 100 196626 fog;
#P window setfont "Sans Serif" 9.;
#P comment 167 74 106 196617 fog ; lighting ; texture ; line_stipple ; polygon_stipple ; cull_face ; alpha_test ; blend ; index_logic_op ; color_logic_op ; dither ; stencil_test ; depth_test ; clip_plane0 ; clip_plane1 ; clip_plane2 ; clip_plane3 ; clip_plane4 ; clip_plane5 ; light0 ; light1 ; light2 ; light3 ; light4 ; light5 ; light6 ; light7 ; texture_gen_s ; texture_gen_t ; texture_gen_r ; texture_gen_q ; point_smooth ; line_smooth ; polygon_smooth ; scissor_test ; color_material ; normalize ; auto_normal ; polygon_offset_point ; polygon_offset_line ; polygon_offset_fill;
#P window setfont "Sans Serif" 18.;
#P comment 166 22 100 196626 enable/ disable;
#P window setfont "Sans Serif" 9.;
#P comment 290 501 106 196617 ambient ; diffuse ; specular ; emission ; ambient_and_diffuse ; shininess;
#P window setfont "Sans Serif" 18.;
#P comment 290 473 137 196626 materialparam;
#P window setfont "Sans Serif" 9.;
#P comment 290 272 101 196617 clear ; and ; and_inverse ; copy ; noop ; xor ; or ; nor ; equiv ; invert ; or_reverse ; copy_inverted ; or_inverted ; nand ; set;
#P window setfont "Sans Serif" 18.;
#P comment 290 244 100 196626 logicop;
#P window setfont "Sans Serif" 9.;
#P comment 30 502 124 196617 ambient ; diffuse ; specular ; emission ; ambient_and_diffuse;
#P window setfont "Sans Serif" 18.;
#P comment 30 474 136 196626 colormaterial;
#P window setfont "Sans Serif" 9.;
#P comment 30 416 131 196617 front 1 ; back 2 (cullface default) ; front_and_back 3 (all others default);
#P window setfont "Sans Serif" 18.;
#P comment 30 388 100 196626 face;
#P comment 30 211 122 196626 blendfunc;
#P comment 30 22 107 196626 draw prims;
#P window setfont "Sans Serif" 9.;
#P comment 30 50 67 196617 lines ; line_loop ; line_strip ; points ; polygon ; quads ; quad_grid ; quad_strip ; triangles ; tri_grid ; tri_fan ; tri_strip;
#P comment 30 240 131 196617 zero 0 ; one 1 ; dst_color 2 ; src_color 3 ; one_minus_dst_color 4 ; one_minus_src_color 5 ; src_alpha 6 ; one_minus_src_alpha 7 ; dst_alpha 8 ; one_minus_dst_alpha 9 ; src_alpha_saturate 10;
#P pop;
#P newobj 490 198 119 196617 p gl_symbolic_constants;
#P window linecount 29;
#P comment 353 221 345 196617 gllogicop ; glmaterial ; glmatrixmode ; glmultmatrix ; glnormal ; glortho ; glpixeltransfer ; glpixelzoom ; glpointsize ; glpolygonmode ; glpolygonoffset ; glpopattrib ; glpopmatrix ; glpushattrib ; glpushmatrix ; glrasterpos ; glreadpixels ; glrect ; glrotate ; glscale ; glscissor ; glshademodel ; gltexcoord ; gltexenv ( ) ; gltexgen ( ) ; gltexparameter ( ) ; gltranslate ; glvertex ; glviewport ;
#P window linecount 4;
#P message 7 24 109 196617 reset , glpointsize 4 , shapeprim points , glcolor 1 0 0 , torus 1. 0.3;
#P window linecount 3;
#P message 141 101 92 196617 glenable lighting , glenable light0 , glenable normalize;
#P window linecount 12;
#P message 357 23 159 196617 reset , glenable texture , glbindtexture grid , cylinder 1. 0.5 , glenable polygon_offset_fill , glpolygonoffset 1. -100. , glcolor 1 0 0 0 , gldisable texture , sphere 0.3 , glpolygonoffset 1. -200. , glcolor 0 0 0 , glenable polygon_offset_line , glpolygonmode front_and_back line , circle 0.3 , gldisable polygon_offset_fill , gldisable polygon_offset_line ,;
#P window linecount 5;
#P message 20 97 103 196617 glbegin line_loop , glvertex 0 0.5 0.5 , glvertex 0.5 0 0.2 , glvertex 0.1 0.5 0.5 , glend;
#P message 129 26 75 196617 glbegin points , glvertex 0 2 0 , glvertex 1 2 0 , glvertex 1 0 1 , glend;
#P window linecount 1;
#P newex 7 229 51 196617 s sketchy;
#P window linecount 12;
#P message 240 22 114 196617 reset , glenable cull_face , glcullface back , shapeslices 50 20 , glcolor 0.4 0.4 0 , cylinder 0.05 0.05 0.5 , moveto 0 0 -0.5 , shapeorient 180 0 0 , circle 0.1 , glcolor 0.3 0.2 1 , moveto 0 0 0.5 , circle 0.2 , moveto 0 0 0.75 , shapeorient 0 0 0 , cylinder 0 0.2 0.25;
#P window linecount 29;
#P comment 62 221 290 196617 glbegin ; glbindtexture ; glblendfunc ; glclear ; glclearcolor ; glcleardepth ; glclipplane

; glcolor () ; glcolormask ; glcolormaterial ; glcullface ; gldepthmask <0/1> ; gldepthrange ; gldisable ; gldrawpixels (src ) ; gledgeflag <0/1> ; glenable ; glend ; glfinish ; glflush ; glfog ; glfrustum ; glhint ; gllight

; gllightmodel ; gllinestipple ; gllinewidth ; glloadidentity ; glloadmatrix ;
#P window linecount 1;
#P comment 352 611 333 196617 SUBJECT TO CHANGE: glDrawPixels , glReadpixels;
#P fasten 17 0 3 0 624 189 12 189;
#P fasten 8 0 3 0 12 152 12 152;
#P fasten 5 0 3 0 25 199 12 199;
#P fasten 4 0 3 0 134 199 12 199;
#P fasten 7 0 3 0 146 199 12 199;
#P fasten 2 0 3 0 245 199 12 199;
#P fasten 6 0 3 0 362 199 12 199;
#P fasten 20 0 3 0 623 149 614 149 614 189 12 189;
#P connect 19 0 18 0;
#P fasten 21 0 18 0 547 48 528 48;
#P fasten 16 0 14 0 638 70 528 70;
#P connect 18 0 14 0;
#P connect 14 0 15 0;
#P pop;
#P newobj 559 85 146 196626 p gl_commands;
#P window setfont "Sans Serif" 9.;
#P newex 374 475 51 196617 s sketchy;
#P newex 172 247 51 196617 r sketchy;
#P newex 412 635 51 196617 s sketchy;
#P message 60 538 78 196617 camera 8 8 8;
#P newex 243 372 40 196617 print;
#P message 47 518 78 196617 camera 2 2 2;
#P message 172 603 69 196617 line_width $1;
#P flonum 172 580 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P message 97 603 69 196617 point_size $1;
#P flonum 97 580 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P flonum 445 579 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P flonum 406 579 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P flonum 367 579 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P toggle 692 520 15 0;
#P newex 653 519 35 196617 sel 27;
#P message 692 540 68 196617 fullscreen $1;
#P toggle 242 580 15 0;
#P message 242 603 44 196617 axes $1;
#P hidden newex 447 -13 50 196617 loadbang;
#P number 50 92 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P toggle 5 92 15 0;
#P newex 5 118 57 196617 qmetro 30;
#P newex 5 172 66 196617 t b erase b b;
#P newex 172 291 193 196617 jit.gl.sketch puddle @rotate -60. 0. 0. 0.;
#B color 5;
#P newex 3 626 209 196617 jit.gl.render puddle @erase_color 0. 0. 0. 1.;
#P newex 610 562 161 196617 jit.window puddle @depthbuffer 1;
#P hidden message 527 -6 14 196617 1;
#P newex 328 598 128 196617 pak position 0. 0. 0.;
#P newex 608 519 40 196617 key;
#P fasten 23 0 4 0 52 567 8 567;
#P fasten 25 0 4 0 65 577 8 577;
#P connect 6 1 4 0;
#P connect 6 0 4 0;
#P connect 57 0 4 0;
#P connect 8 0 7 0;
#P connect 7 0 6 0;
#P connect 49 0 48 0;
#P hidden connect 40 0 41 0;
#P connect 9 0 7 1;
#P connect 35 0 56 0;
#P connect 48 0 35 0;
#P connect 51 0 35 0;
#P connect 19 0 20 0;
#P connect 58 0 59 0;
#P connect 59 0 47 0;
#P connect 47 0 50 0;
#P fasten 5 1 38 0 360 318 169 318;
#P connect 38 0 37 0;
#P connect 43 4 46 0;
#P connect 50 0 46 0;
#P connect 27 0 5 0;
#P fasten 35 0 5 0 90 285 177 285;
#P connect 21 0 22 0;
#P connect 52 0 51 1;
#P connect 34 0 33 0;
#P connect 4 0 30 0;
#P connect 53 0 51 2;
#P connect 12 0 11 0;
#P fasten 37 0 24 0 169 367 248 367;
#P connect 38 1 24 0;
#P connect 54 0 51 3;
#P connect 55 0 51 4;
#P connect 6 3 42 0;
#P connect 16 0 1 1;
#P connect 46 0 28 0;
#P connect 43 5 28 0;
#P fasten 33 0 28 0 211 431 379 431;
#P connect 42 0 43 0;
#P connect 17 0 1 2;
#P fasten 36 0 26 0 602 627 417 627;
#P fasten 22 0 26 0 177 627 417 627;
#P fasten 20 0 26 0 102 627 417 627;
#P fasten 1 0 26 0 333 627 417 627;
#P fasten 11 0 26 0 247 627 417 627;
#P connect 18 0 1 3;
#P hidden connect 10 0 2 0;
#P fasten 13 0 3 0 697 557 615 557;
#P connect 44 0 3 0;
#P fasten 0 0 14 0 613 538 650 538 650 517 658 517;
#P fasten 14 0 15 0 658 537 689 537 689 517 697 517;
#P connect 15 0 13 0;
#P connect 45 0 44 0;
#P pop;


April 5, 2007 | 1:00 pm

don’t have time to look at the patch, but if you’re looking for distortions, you may want to check out repos, either on matrices or in a shader, or using a texture on a nurbs/mesh surface. See the pool3D patch in the "examples" folder.
-na


April 5, 2007 | 2:55 pm

Thanks – I’ll take a look!


April 6, 2007 | 12:17 am

I was going to say the same thing about pool3D.

h(x, y, t+1) = damping * (1/2 * ( h(x+1, y, t) + h(x-1, y, t) + h(x,
y+1, t) + h(x, y-1, t)) – h(x, y, t-1))

Here’s the formula used for that patch. Maybe you could figure out a
way to draw using that formula, assuming you really want to use
sketch.

Keith

On 4/5/07, Nadav Assor wrote:
>
> don’t have time to look at the patch, but if you’re looking for distortions, you may want to check out repos, either on matrices or in a shader, or using a texture on a nurbs/mesh surface. See the pool3D patch in the "examples" folder.
> -na
>


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