Simple question

Mar 7, 2008 at 11:07am

Simple question

I’ve got a simple question. I think i’ve got it because I just don’t really get the render object in jitter:

If I want to apply a simple effect (like jit.slide) to a rendered object (as i.e. the square you get in the help file of jit.gl.render) how should I do that?

Thanks in advance.

Where should i dig deeper into to better understand this principle?

#P window setfont “Sans Serif” 9.;
#P window linecount 1;
#P newex 706 511 45 9109513 s meshy;
#P flonum 799 103 35 9 0 0 0 139 0 0 0 221 221 221 222 222 222 0 0 0;
#P message 799 125 73 9109513 slide_down $1;
#P flonum 736 97 35 9 0 0 0 139 0 0 0 221 221 221 222 222 222 0 0 0;
#P message 736 125 60 9109513 slide_up $1;
#P newex 784 176 37 9109513 jit.slide;
#P window setfont “Sans Serif” 18.;
#P comment 15 10 108 9109522 jit.gl.render;
#P window setfont “Sans Serif” 9.;
#P comment 15 35 78 9109513 Render Open GL;
#P user panel 10 5 400 50;
#X brgb 255 255 255;
#X frgb 0 0 0;
#X border 0;
#X rounded 0;
#X shadow 0;
#X done;
#P message 767 607 55 9109513 jit.window;
#P message 705 607 61 9109513 jit.pwindow;
#P message 651 607 53 9109513 jit.matrix;
#P message 587 607 63 9109513 jit.gl.text3d;
#P message 523 607 63 9109513 jit.gl.text2d;
#P message 460 607 62 9109513 jit.gl.sketch;
#P message 404 607 55 9109513 jit.gl.plato;
#P message 345 607 58 9109513 jit.gl.nurbs;
#P message 285 607 59 9109513 jit.gl.model;
#P message 223 607 61 9109513 jit.gl.handle;
#P message 147 607 75 9109513 jit.gl.gridshape;
#P hidden newex 18 653 104 9109513 bgcolor 255 230 230;
#P comment 147 593 48 9109513 see also:;
#P hidden newex 587 629 64 9109513 prepend help;
#P hidden newex 587 650 45 9109513 pcontrol;
#P hidden newex 18 632 104 9109513 jit.obref jit.gl.render;
#P button 18 607 15 0;
#P comment 34 609 112 9109513 • view html reference.;
#P user jit.fpsgui 552 573 60 9109513 0;
#P window linecount 6;
#P comment 16 325 105 9109513 matrix destinations use the software renderer , which will be slower than drawing directly into a window or pwindow using 3D hardware.;
#P window linecount 4;
#P comment 126 361 103 9109513 pwindow destinations must be named with the “name” message in order to be used.;
#P window linecount 1;
#P newex 217 545 30 9109513 print;
#P message 180 444 50 9109513 getname;
#P message 127 444 50 9109513 name yon;
#P message 164 273 59 9109513 drawto yon;
#P window linecount 2;
#P comment 633 273 93 9109513 matrices don’t care how they’re used.;
#P toggle 590 469 15 0;
#P window linecount 1;
#P newex 590 489 27 9109513 + 1;
#P newex 590 511 40 9109513 switch;
#P window linecount 2;
#P comment 632 399 93 9109513 or the texture matrix as geometry.;
#P newex 632 447 115 9109513 jit.matrix 5 float32 64 64 @planemap 1 2 3 2 3;
#P window linecount 3;
#P comment 632 308 93 9109513 try using the geometry matrix as a texture…;
#P window linecount 1;
#P message 656 374 75 9109513 usetexture geo;
#P newex 633 354 98 9109513 prepend texture geo;
#P comment 474 482 35 9109513 use it.;
#P comment 474 502 48 9109513 delete it.;
#P comment 501 212 45 9109513 • use it.;
#P comment 474 460 79 9109513 make a texture.;
#P window linecount 2;
#P message 249 468 51 9109513 rotate $1 0 0 1;
#P window linecount 1;
#N counter 360;
#X flags 0 0;
#P newobj 249 445 63 9109513 counter 360;
#P comment 389 182 161 9109513 create or update a named texture.;
#P hidden message 369 411 14 9109513 7;
#P hidden newex 152 116 50 9109513 loadbang;
#N vpatcher 281 135 876 696;
#P origin 0 -12;
#P window setfont “Sans Serif” 9.;
#P hidden newex 250 523 104 9109513 bgcolor 255 230 230;
#P message 351 35 91 9109513 name jitcolor;
#P hidden message 5 448 14 9109513 7;
#P hidden message 5 430 14 9109513 6;
#P comment 91 444 55 9109513 destination;
#P comment 173 435 277 9109513 when blend_enable is on , blend_mode controls the choice of blend operations for source over destination. see the table at right for the modes which correspond to integers 1-13. for a full discussion of these modes see p. 223 of the OpenGL “red book”. better docs will show up here later.;
#P comment 175 379 277 9109513 enable blending of the texture/vertex/drawcolor combination with the background. if blend_enable is off , the background is replaced with the computed fragment.;
#P comment 174 321 277 9109513 current color to erase with when erase message is received. if alpha is less than 0 , a large polygon is drawn which will partially erase the entire image with the color.;
#P hidden message 474 31 104 9109513 quads , camera 0 0 4 , smooth_shading 1 , blend_enable 0;
#P message 260 74 65 9109513 usetexture 0;
#P message 232 35 93 9109513 texture xxx 64 64;
#P message 232 216 90 9109513 deletetexture xxx;
#P message 247 54 78 9109513 usetexture xxx;
#P newex 158 75 75 9109513 t b b b erase;
#P toggle 158 34 15 0;
#P newex 158 54 55 9109513 metro 100;
#P user jit.pwindow 350 58 220 131 0 1 0 0 1 0;
#X name jitcolor;
#P newex 473 521 100 9109513 jit.gl.render jitcolor;
#B color 5;
#P newex 270 130 70 9109513 jit.matrix colorx 12 float32 4 1;
#P hidden newex 10 22 50 9109513 loadbang;
#P newex 10 212 70 9109513 jit.fill colorx;
#P message 10 103 95 9109513 plane 0 , 1 -1 -1 1 , plane 1 , -1 -1 1 1 , plane 3 , 1 0 0 1 , plane 4 , 1 1 0 0 , plane 8 , 1 1 0 0 , plane 9 , 0 1 1 0 , plane 10 , 0 0 1 1 , plane 11 , 0 1 0 1;
#P comment 107 103 62 9109513 a square with texture coordinates and vertex colors.;
#P comment 7 36 140 9109513 order of planes for geometry matrix: x , y , z , s , t , r , g , b , a , nx , ny , nz. see geometry subpatch for more info.;
#P toggle 26 380 15 0;
#P message 26 399 80 9109513 blend_enable $1;
#P flonum 132 320 35 9 0 0 0 139 0 0 0 221 221 221 222 222 222 0 0 0;
#P flonum 97 320 35 9 0 0 0 139 0 0 0 221 221 221 222 222 222 0 0 0;
#P flonum 62 320 35 9 0 0 0 139 0 0 0 221 221 221 222 222 222 0 0 0;
#P flonum 27 320 35 9 0 0 0 139 0 0 0 221 221 221 222 222 222 0 0 0;
#P newex 27 340 128 9109513 pak erase_color 0. 0. 0. 1.;
#P flonum 131 258 35 9 0 0 0 139 0 0 0 221 221 221 222 222 222 0 0 0;
#P flonum 96 258 35 9 0 0 0 139 0 0 0 221 221 221 222 222 222 0 0 0;
#P flonum 61 258 35 9 0 0 0 139 0 0 0 221 221 221 222 222 222 0 0 0;
#P flonum 26 258 35 9 0 0 0 139 0 0 0 221 221 221 222 222 222 0 0 0;
#P newex 26 278 95 9109513 pak color 1. 1. 1. 1.;
#P number 92 460 35 9 0 0 0 139 0 0 0 221 221 221 222 222 222 0 0 0;
#P number 29 460 35 9 0 0 0 139 0 0 0 221 221 221 222 222 222 0 0 0;
#P newex 26 480 95 9109513 pak blend_mode 1 0;
#P comment 176 258 277 9109513 current draw color for nontextured primitives: R , G , B , alpha. Textured pixels are also multiplied by this color , if vertex colors are not specified in the geometry matrix.;
#P comment 29 445 55 9109513 source;
#P hidden connect 21 0 37 0;
#P hidden connect 21 0 38 0;
#P hidden connect 21 0 19 0;
#P connect 19 0 20 0;
#P connect 16 0 15 0;
#P hidden connect 37 0 3 0;
#P fasten 6 0 5 1 31 275 52 275;
#P fasten 11 0 10 1 32 337 61 337;
#P fasten 7 0 5 2 66 275 73 275;
#P fasten 3 0 2 1 34 477 73 477;
#P fasten 12 0 10 2 67 337 90 337;
#P fasten 8 0 5 3 101 275 94 275;
#P hidden connect 38 0 4 0;
#P fasten 9 0 5 4 136 275 115 275;
#P fasten 4 0 2 2 97 477 115 477;
#P fasten 13 0 10 3 102 337 119 337;
#P fasten 14 0 10 4 137 337 148 337;
#P connect 26 0 25 0;
#P connect 25 0 27 0;
#P fasten 27 2 22 0 205 121 275 121;
#P hidden connect 21 0 39 0;
#P connect 39 0 24 0;
#P fasten 2 0 23 0 31 509 478 509;
#P fasten 10 0 23 0 32 363 478 363;
#P fasten 5 0 23 0 31 302 478 302;
#P hidden connect 32 0 23 0;
#P fasten 27 3 23 0 226 206 478 206;
#P fasten 28 0 23 0 252 206 478 206;
#P fasten 30 0 23 0 237 206 478 206;
#P fasten 27 1 23 0 184 206 478 206;
#P fasten 31 0 23 0 265 206 478 206;
#P fasten 29 0 23 0 237 248 478 248;
#P fasten 15 0 23 0 31 421 478 421;
#P fasten 22 0 23 0 275 204 478 204;
#P hidden connect 21 0 32 0;
#P pop;
#P newobj 592 154 50 9109513 p colors;
#P comment 15 246 105 9109513 hit esc for fullscreen.;
#P newex 297 136 79 9109513 t b b b b l erase;
#P window linecount 4;
#P comment 388 361 146 9109513 when jit.render gets a matrix message , it renders the geometry in the matrix using the current primitive.;
#P window linecount 1;
#P newex 389 299 61 9109513 jit.fill geom;
#P window linecount 4;
#P message 389 242 96 9109513 plane 0 , 1 -1 -1 1 , plane 1 , -1 -1 1 1 , plane 3 , 1 0 0 1 , plane 4 , 1 1 0 0;
#P window linecount 1;
#P newex 388 330 139 9109513 jit.matrix geom 5 float32 4 1;
#N vpatcher 660 62 1063 315;
#P window setfont “Sans Serif” 9.;
#P hidden newex 109 205 104 9109513 bgcolor 255 230 230;
#P outlet 13 210 15 0;
#P toggle 13 31 15 0;
#P message 13 50 81 9109513 depth_enable $1;
#P comment 109 78 267 9109513 the geometry matrix is used by jit.render according to the number of planes in it. if there are three planes in the matrix , they correspond to vertex coordinates x , y , and z. if there are five planes in the matrix , they correspond to vertex coordinates x , y , z , and texture coordinates s and t. if there are eight planes in the matrix , they correspond to x , y , z , s , t , and normal vector components nx , ny , and nz. if there are twelve planes in the matrix , they correspond to x , y , z , s , t , nx , ny , nz , and color components r , g , b , and a.;
#P comment 109 51 268 9109513 enable z-buffer depth testing for hidden-surface removal.;
#P connect 3 0 2 0;
#P connect 2 0 4 0;
#P pop;
#P newobj 592 206 118 9109513 p more_geometry;
#P window linecount 2;
#P comment 16 292 218 9109513 use the drawto message to set either a matrix , window or pwindow destination.;
#P user jit.pwindow 415 110 54 43 0 1 0 0 1 0;
#P window linecount 1;
#P comment 17 131 149 9109513 argument: initial destination.;
#P window linecount 3;
#P newex 16 202 111 9109513 jit.window thither @rect 10 50 160 160 @floating 1;
#P window linecount 1;
#N vpatcher 382 48 800 418;
#P window setfont “Sans Serif” 9.;
#P hidden newex 169 357 104 9109513 bgcolor 255 230 230;
#P flonum 326 234 35 9 0 0 0 139 0 0 0 221 221 221 222 222 222 0 0 0;
#P flonum 290 234 35 9 0 0 0 139 0 0 0 221 221 221 222 222 222 0 0 0;
#P flonum 254 234 35 9 0 0 0 139 0 0 0 221 221 221 222 222 222 0 0 0;
#P newex 254 265 95 9109513 pak position 0. 0. 0.;
#P flonum 349 174 35 9 0 0 0 139 0 0 0 221 221 221 222 222 222 0 0 0;
#P flonum 313 174 35 9 0 0 0 139 0 0 0 221 221 221 222 222 222 0 0 0;
#P flonum 277 174 35 9 0 0 0 139 0 0 0 221 221 221 222 222 222 0 0 0;
#P flonum 241 174 35 9 0 0 0 139 0 0 0 221 221 221 222 222 222 0 0 0;
#P newex 241 205 102 9109513 pak rotate 0. 0. 0. 0.;
#P flonum 301 116 35 9 0 0 0 139 0 0 0 221 221 221 222 222 222 0 0 0;
#P flonum 265 116 35 9 0 0 0 139 0 0 0 221 221 221 222 222 222 0 0 0;
#P flonum 229 116 35 9 0 0 0 139 0 0 0 221 221 221 222 222 222 0 0 0;
#P newex 229 147 85 9109513 pak scale 0. 0. 0.;
#P outlet 19 339 15 0;
#P flonum 205 1 35 9 0 0 0 139 0 0 0 221 221 221 222 222 222 0 0 0;
#P message 205 28 70 9109513 lens_angle $1;
#P flonum 289 58 35 9 0 0 0 139 0 0 0 221 221 221 222 222 222 0 0 0;
#P flonum 253 58 35 9 0 0 0 139 0 0 0 221 221 221 222 222 222 0 0 0;
#P flonum 217 58 35 9 0 0 0 139 0 0 0 221 221 221 222 222 222 0 0 0;
#P newex 217 89 95 9109513 pak camera 0. 0. 0.;
#P flonum 142 58 35 9 0 0 0 139 0 0 0 221 221 221 222 222 222 0 0 0;
#P flonum 106 58 35 9 0 0 0 139 0 0 0 221 221 221 222 222 222 0 0 0;
#P flonum 70 58 35 9 0 0 0 139 0 0 0 221 221 221 222 222 222 0 0 0;
#P newex 70 89 89 9109513 pak lookat 0. 0. 0.;
#P toggle 19 10 15 0;
#P message 19 30 45 9109513 ortho $1;
#P connect 1 0 0 0;
#P fasten 22 0 12 0 259 308 24 308;
#P fasten 17 0 12 0 246 243 24 243;
#P fasten 13 0 12 0 234 212 24 212;
#P fasten 6 0 12 0 222 183 24 183;
#P fasten 2 0 12 0 75 142 24 142;
#P connect 0 0 12 0;
#P fasten 10 0 12 0 210 156 24 156;
#P fasten 3 0 2 1 75 81 101 81;
#P fasten 4 0 2 2 111 81 127 81;
#P fasten 5 0 2 3 147 81 153 81;
#P connect 11 0 10 0;
#P fasten 7 0 6 1 222 81 250 81;
#P fasten 14 0 13 1 234 139 259 139;
#P fasten 18 0 17 1 246 197 269 197;
#P fasten 8 0 6 2 258 81 278 81;
#P fasten 15 0 13 2 270 139 284 139;
#P fasten 23 0 22 1 259 257 287 257;
#P fasten 19 0 17 2 282 197 292 197;
#P fasten 9 0 6 3 294 81 306 81;
#P fasten 16 0 13 3 306 139 309 139;
#P fasten 20 0 17 3 318 197 315 197;
#P fasten 24 0 22 2 295 257 315 257;
#P fasten 21 0 17 4 354 197 338 197;
#P fasten 25 0 22 3 331 257 343 257;
#P pop;
#P newobj 592 232 108 9109513 p viewing_transforms;
#N vpatcher 513 110 958 379;
#P window setfont “Sans Serif” 9.;
#P hidden newex 163 203 104 9109513 bgcolor 255 230 230;
#P newex 6 50 50 9109513 t b l;
#P message 55 117 78 9109513 usetexture blue;
#P outlet 142 233 15 0;
#P toggle 84 158 15 0;
#P message 84 176 50 9109513 interp $1;
#P newex 32 95 101 9109513 prepend texture blue;
#P message 6 26 111 9109513 setall 1. 0.2 0.7 1.;
#P newex 6 74 128 9109513 jit.matrix 4 float32 10 10;
#P comment 163 74 248 9109513 you can put any data you like into a matrix and make a texture out if it. data types other than char get converted to char.;
#P comment 163 157 248 9109513 turns taxel interpolation on/off for the currently selected texture. this attribute remains linked to the texture. new textures interpolate by default.;
#P connect 3 0 9 0;
#P connect 9 0 2 0;
#P fasten 9 1 2 0 51 70 11 70;
#P fasten 2 0 4 0 11 94 37 94;
#P connect 6 0 5 0;
#P fasten 4 0 7 0 37 115 147 115;
#P fasten 5 0 7 0 89 197 147 197;
#P fasten 8 0 7 0 60 138 147 138;
#P pop;
#P newobj 592 179 82 9109513 p more_textures;
#P user ubumenu 388 422 68 9109513 0 1 1 0;
#X add points;
#X add lines;
#X add line_strip;
#X add line_loop;
#X add triangles;
#X add tri_strip;
#X add tri_fan;
#X add quads;
#X add quad_strip;
#X add polygon;
#X add tri_grid;
#X prefix_set 0 0 0;
#P message 404 521 65 9109513 usetexture 0;
#P user jit.pwindow 16 465 102 77 0 1 0 0 1 0;
#P window linecount 2;
#P newex 17 430 103 9109513 jit.matrix hither @dim 100 75;
#P window linecount 1;
#P message 16 273 70 9109513 drawto hither;
#P message 88 273 74 9109513 drawto thither;
#P message 376 458 93 9109513 texture xxx 64 64;
#P message 379 501 90 9109513 deletetexture xxx;
#P message 391 481 78 9109513 usetexture xxx;
#P message 360 79 28 9109513 read;
#P message 425 79 27 9109513 stop;
#P message 391 79 31 9109513 start;
#P toggle 297 58 15 0;
#P newex 297 79 55 9109513 metro 20;
#P newex 297 111 103 9109513 jit.qt.movie 256 256;
#P message 389 210 108 9109513 usetexture mytexture;
#P newex 389 161 131 9109513 prepend texture mytexture;
#P toggle 100 161 15 0;
#P newex 61 160 35 9109513 sel 27;
#P newex 16 160 40 9109513 key;
#P newex 16 182 91 9109513 prepend fullscreen;
#P newex 552 551 95 9109513 jit.gl.render thither;
#B color 5;
#P window linecount 4;
#P comment 486 242 66 9109513 four vertices make a square with texture coordinates.;
#P window linecount 1;
#P comment 313 60 149 9109513 • read a move and start metro.;
#P comment 473 522 75 9109513 0 = no texture.;
#P window linecount 3;
#P comment 261 500 38 9109513 rotate around z axis;
#P user jit.pwindow 126 464 102 77 0 1 0 0 1 0;
#X name yon;
#P objectname where;
#P window linecount 1;
#P comment 457 424 94 9109513 choose a primitive.;
#P connect 92 0 91 0;
#P connect 90 0 89 0;
#P connect 89 0 88 0;
#P connect 91 0 88 0;
#P fasten 35 0 56 1 393 357 566 357 566 508 610 508;
#P fasten 35 0 51 0 393 351 638 351;
#P fasten 39 2 35 0 328 321 393 321;
#P fasten 39 2 54 0 328 441 637 441;
#P fasten 39 4 11 0 354 158 394 158;
#P fasten 39 4 54 0 354 441 637 441;
#P fasten 54 0 56 2 637 497 625 497;
#P connect 57 0 56 0;
#P connect 58 0 57 0;
#P hidden connect 42 0 61 0;
#P hidden connect 42 0 43 0;
#P hidden connect 42 0 36 0;
#P hidden connect 42 0 57 0;
#P hidden connect 71 0 70 0;
#P hidden fasten 83 0 71 0 710 625 592 625;
#P hidden fasten 82 0 71 0 656 625 592 625;
#P hidden fasten 84 0 71 0 772 625 592 625;
#P hidden fasten 81 0 71 0 592 625 592 625;
#P hidden fasten 80 0 71 0 528 625 592 625;
#P hidden fasten 79 0 71 0 465 625 592 625;
#P hidden fasten 78 0 71 0 409 625 592 625;
#P hidden fasten 77 0 71 0 350 625 592 625;
#P hidden fasten 76 0 71 0 290 625 592 625;
#P hidden fasten 75 0 71 0 228 625 592 625;
#P hidden fasten 74 0 71 0 152 625 592 625;
#P connect 6 0 66 0;
#P fasten 56 0 6 0 595 539 557 539;
#P fasten 11 0 6 0 394 180 557 180;
#P fasten 29 0 6 0 597 254 557 254;
#P hidden fasten 23 0 6 0 21 410 557 410;
#P fasten 20 0 6 0 384 519 557 519;
#P fasten 12 0 6 0 394 236 557 236;
#P fasten 19 0 6 0 396 499 557 499;
#P fasten 21 0 6 0 381 476 557 476;
#P hidden fasten 22 0 6 0 93 415 557 415;
#P fasten 26 0 6 0 409 539 557 539;
#P fasten 39 1 6 0 315 542 557 542;
#P fasten 39 5 6 0 367 542 557 542;
#P fasten 46 0 6 0 254 542 557 542;
#P fasten 34 0 6 0 597 227 557 227;
#P fasten 28 0 6 0 597 201 557 201;
#P fasten 52 0 6 0 661 393 557 393;
#P fasten 51 0 6 0 638 381 557 381;
#P hidden connect 60 0 6 0;
#P fasten 27 1 6 0 422 451 557 451;
#P connect 13 0 39 0;
#P fasten 13 0 32 0 302 131 406 131 406 109 421 109;
#P connect 36 0 37 0;
#P hidden connect 43 0 27 0;
#P fasten 14 0 13 0 302 105 302 105;
#P fasten 18 0 13 0 365 105 302 105;
#P fasten 17 0 13 0 430 105 302 105;
#P fasten 16 0 13 0 396 105 302 105;
#P connect 15 0 14 0;
#P connect 45 0 46 0;
#P fasten 39 3 45 0 341 434 254 434;
#P connect 1 1 63 0;
#P connect 61 0 1 0;
#P fasten 62 0 1 0 185 462 132 462;
#P fasten 9 0 10 0 66 178 97 178 97 158 105 158;
#P fasten 8 0 9 0 21 179 58 179 58 158 66 158;
#P hidden connect 68 0 69 0;
#P connect 24 0 25 0;
#P fasten 39 0 24 0 302 418 22 418;
#P connect 7 0 30 0;
#P fasten 10 0 7 0 105 180 21 180;
#P window clipboard copycount 94;

#36242
Mar 7, 2008 at 5:14pm

jit.slide is for matrix processing.
jit.gl.render manages an opengl context (therefore will not interact with a matrix processing object).

however, you can a tell gl.render to render to a named matrix, and then use jit.slide on that matrix.

if you look at the help file, in the lower left corner there is a matrix named hither. if you press the “drawto hither” message box, gl.render will do just that, and you can connect jit.slide to the output of hither.

all this is covered in the tutorials and reference files.
-rob

#124252
Apr 2, 2008 at 9:19am

Thanks man,

I got this working, but it’s kinda CPU expensive. Is it also possible to use a slab to create this effect. In the jitter examples I saw the jit.gl.slab-slide patch. But it’s used on a video, not on a jit.gl.model. Does anyone has an idea how I could do this?

Thanks in advance!

#124253
Apr 2, 2008 at 7:41pm

render to texture and process the texture with slabs.

check out recipe 21

http://www.cycling74.com/story/2006/2/14/161736/108

#124254

You must be logged in to reply to this topic.