color_matrix jit.gl.multipale usage


    Nov 29 2006 | 9:46 am
    hi, included is a trimmed down version of the multipale help file. i cant make glparam color work

    • Nov 29 2006 | 10:03 am
      it works with float32 matrix and not a char 4 plane as the help file states.
      On 11/29/06, yair reshef wrote: > > hi, included is a trimmed down version of the multipale help file. > i cant make glparam color work > > max v2; > #N vpatcher 439 48 1248 675; > #P origin -2 0; > #P window setfont "Sans Serif" 9.; > #P window linecount 2; > #P newex 254 152 227 9109513 jit.expr @expr "snorm[0]*2" "snorm[1]*2" > "cos(snorm[0]*TWOPI)*sin(snorm[1]*TWOPI)"; > #P window linecount 1; > #P newex 254 128 130 9109513 jit.matrix 3 float32 3 3; > #P newex 530 135 110 9109513 jit.matrix col; > #P user jit.pwindow 529 162 82 62 0 1 0 0 1 0; > #P button 529 89 15 0; > #P newex 530 109 110 9109513 jit.noise 4 char 3 3; > #P message 300 201 74 9109513 color_matrix col; > #P comment 323 315 114 9109513 (similar to jit.gl.sketch); > #P comment 323 299 244 9109513 targetname > attributes>; > #P newex 164 340 54 9109513 s multiple; > #P toggle 164 299 15 0; > #P message 164 321 76 9109513 targetmode $1; > #P newex 78 188 41 9109513 s draw; > #P newex 255 88 56 9109513 r loadbang; > #P newex 83 354 56 9109513 s loadbang; > #P newex 472 259 32 9109513 print; > #P newex 160 155 54 9109513 r multiple; > #P newex 65 325 48 9109513 loadbang; > #P message 172 190 65 9109513 getglparams; > #P user jit.fpsgui 58 210 60 9109513 0; > #P message 52 434 34 9109513 reset; > #P newex 52 453 255 9109513 jit.gl.handle foo @inherit_transform 1 > @auto_rotate 1; > #P window setfont "Sans Serif" 18.; > #P comment 34 34 136 9109522 jit.gl.multiple; > #P window setfont "Sans Serif" 9.; > #P comment 34 59 251 9109513 Use matrices to draw many instances of a gl > object; > #P user panel 29 29 400 50; > #X brgb 255 255 255; > #X frgb 0 0 0; > #X border 0; > #X rounded 0; > #X shadow 0; > #X done; > #P toggle 476 453 15 0; > #P message 476 471 55 9109513 floating $1; > #P toggle 403 453 15 0; > #P newex 364 452 35 9109513 sel 27; > #P message 403 471 68 9109513 fullscreen $1; > #P newex 321 495 188 9109513 jit.window foo @depthbuffer 1 @sync 0; > #P newex 319 452 40 9109513 key; > #P number 75 106 35 9 0 0 0 139 0 0 0 221 221 221 222 222 222 0 0 0; > #P toggle 34 106 15 0; > #P newex 34 128 51 9109513 qmetro 2; > #P newex 34 150 58 9109513 t b b erase; > #P newex 34 495 271 9109513 jit.gl.render foo @erase_color 1. 1. 1. 1. > @camera 0 0 -6; > #P button 65 353 15 0; > #P button 255 109 15 0; > #P window linecount 2; > #P newex 65 379 347 9109513 jit.gl.gridshape foo @shape torus > @lighting_enable 1 @blend_enable 1 @smooth_shading 1 @automatic 0 > @depth_enable 1 @dim 10 10 @name me; > #P newex 246 225 227 9109513 jit.gl.multiple foo 2 @targetname me > @glparams position color; > #B color 5; > #P window linecount 1; > #P comment 185 299 125 9109513 > #P connect 8 0 7 0; > #P connect 7 0 6 0; > #P fasten 20 0 5 0 57 482 39 482; > #P fasten 6 2 5 0 87 173 39 173; > #P connect 6 0 5 0; > #P connect 21 0 20 0; > #P connect 6 1 22 0; > #P connect 24 0 4 0; > #P connect 4 0 2 0; > #P connect 9 0 7 1; > #P fasten 6 1 29 0 63 182 83 182; > #P fasten 24 0 27 0 70 348 88 348; > #P connect 31 0 30 0; > #P connect 30 0 32 0; > #P connect 41 0 1 0; > #P fasten 35 0 1 0 245 231; > #P fasten 23 0 1 0 177 221 251 221; > #P fasten 25 0 1 0 165 221 251 221; > #P connect 3 0 40 0; > #P connect 40 0 41 0; > #P connect 28 0 3 0; > #P fasten 15 0 11 0 481 490 326 490; > #P fasten 12 0 11 0 408 490 326 490; > #P fasten 10 0 13 0 324 471 361 471 361 450 369 450; > #P fasten 13 0 14 0 369 470 400 470 400 450 408 450; > #P connect 14 0 12 0; > #P connect 39 0 1 1; > #P fasten 1 1 26 0 468 258 477 258; > #P connect 16 0 15 0; > #P connect 6 1 36 0; > #P connect 37 0 36 0; > #P connect 36 0 39 0; > #P connect 39 0 38 0; > #P pop; > >
    • Nov 29 2006 | 10:21 am
      jit.gl.multiple's params are in general like the opengl params. Color in opengl is specified by 4 floats in RGBA format. This is how the color_matrix has to be formatted:
    • Nov 29 2006 | 10:32 am
      thnx wes, again nevertheless that help file should be fixed
      On 11/29/06, Wesley Smith wrote: > > jit.gl.multiple's params are in general like the opengl params. Color > in opengl is specified by 4 floats in RGBA format. This is how the > color_matrix has to be formatted: > > #P window setfont "Sans Serif" 9.; > #P window linecount 2; > #P newex 314 212 227 196617 jit.expr @expr "snorm[0]*2" "snorm[1]*2" > "cos(snorm[0]*TWOPI)*sin(snorm[1]*TWOPI)"; > #P window linecount 1; > #P newex 314 188 130 196617 jit.matrix 3 float32 3 3; > #P newex 590 195 110 196617 jit.matrix col; > #P user jit.pwindow 589 222 82 62 0 1 0 0 1 0; > #P button 589 149 15 0; > #P newex 590 169 110 196617 jit.noise 4 float32 3 3; > #P message 360 261 93 196617 color_matrix col; > #P comment 383 375 114 196617 (similar to jit.gl.sketch); > #P comment 383 359 244 196617 targetname > attributes>; > #P newex 224 400 54 196617 s multiple; > #P toggle 224 359 15 0; > #P message 224 381 76 196617 targetmode $1; > #P newex 138 248 41 196617 s draw; > #P newex 315 148 56 196617 r loadbang; > #P newex 143 414 56 196617 s loadbang; > #P newex 532 319 32 196617 print; > #P newex 220 215 54 196617 r multiple; > #P newex 125 385 48 196617 loadbang; > #P message 232 250 65 196617 getglparams; > #P user jit.fpsgui 118 270 60 196617 0; > #P message 112 494 34 196617 reset; > #P newex 112 513 255 196617 jit.gl.handle foo @inherit_transform 1 > @auto_rotate 1; > #P window setfont "Sans Serif" 18.; > #P comment 94 94 136 196626 jit.gl.multiple; > #P window setfont "Sans Serif" 9.; > #P comment 94 119 251 196617 Use matrices to draw many instances of a gl > object; > #P user panel 89 89 400 50; > #X brgb 255 255 255; > #X frgb 0 0 0; > #X border 0; > #X rounded 0; > #X shadow 0; > #X done; > #P toggle 536 513 15 0; > #P message 536 531 55 196617 floating $1; > #P toggle 463 513 15 0; > #P newex 424 512 35 196617 sel 27; > #P message 463 531 68 196617 fullscreen $1; > #P newex 381 555 188 196617 jit.window foo @depthbuffer 1 @sync 0; > #P newex 379 512 40 196617 key; > #P number 135 166 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0; > #P toggle 94 166 15 0; > #P newex 94 188 51 196617 qmetro 2; > #P newex 94 210 58 196617 t b b erase; > #P newex 94 555 271 196617 jit.gl.render foo @erase_color 1. 1. 1. 1. > @camera 0 0 -6; > #P button 125 413 15 0; > #P button 315 169 15 0; > #P window linecount 2; > #P newex 125 439 404 196617 jit.gl.gridshape foo @shape torus > @lighting_enable 1 @blend_enable 1 @smooth_shading 1 @automatic 0 > @depth_enable 1 @dim 10 10 @name me @color 1 0 0 1; > #P newex 306 285 227 196617 jit.gl.multiple foo 2 @targetname me > @glparams position color; > #B color 5; > #P window linecount 1; > #P comment 245 359 125 196617 > #P connect 4 0 2 0; > #P connect 6 1 22 0; > #P fasten 6 1 29 0 123 242 143 242; > #P connect 6 1 36 0; > #P connect 37 0 36 0; > #P connect 36 0 39 0; > #P connect 39 0 1 1; > #P connect 39 0 38 0; > #P connect 16 0 15 0; > #P fasten 1 1 26 0 528 318 537 318; > #P connect 14 0 12 0; > #P fasten 13 0 14 0 429 530 460 530 460 510 468 510; > #P fasten 10 0 13 0 384 531 421 531 421 510 429 510; > #P fasten 12 0 11 0 468 550 386 550; > #P fasten 15 0 11 0 541 550 386 550; > #P connect 28 0 3 0; > #P connect 40 0 41 0; > #P connect 3 0 40 0; > #P fasten 25 0 1 0 225 281 311 281; > #P fasten 23 0 1 0 237 281 311 281; > #P fasten 35 0 1 0 305 291; > #P connect 41 0 1 0; > #P connect 30 0 32 0; > #P connect 31 0 30 0; > #P connect 24 0 4 0; > #P fasten 24 0 27 0 130 408 148 408; > #P connect 9 0 7 1; > #P connect 21 0 20 0; > #P connect 6 0 5 0; > #P fasten 6 2 5 0 147 233 99 233; > #P fasten 20 0 5 0 117 542 99 542; > #P connect 7 0 6 0; > #P connect 8 0 7 0; > #P window clipboard copycount 42; >
    • Nov 29 2006 | 10:38 am
      thanks for pointing this out. It's fixed.
      wes
      On 11/29/06, yair reshef wrote: > thnx wes, again > nevertheless that help file should be fixed > > > On 11/29/06, Wesley Smith wrote: > > > > jit.gl.multiple's params are in general like the opengl params. Color > > in opengl is specified by 4 floats in RGBA format. This is how the > > color_matrix has to be formatted: > > > > #P window setfont "Sans Serif" 9.; > > #P window linecount 2; > > #P newex 314 212 227 196617 jit.expr @expr "snorm[0]*2" "snorm[1]*2" > > "cos(snorm[0]*TWOPI)*sin(snorm[1]*TWOPI)"; > > #P window linecount 1; > > #P newex 314 188 130 196617 jit.matrix 3 float32 3 3; > > #P newex 590 195 110 196617 jit.matrix col; > > #P user jit.pwindow 589 222 82 62 0 1 0 0 1 0; > > #P button 589 149 15 0; > > #P newex 590 169 110 196617 jit.noise 4 float32 3 3; > > #P message 360 261 93 196617 color_matrix col; > > #P comment 383 375 114 196617 (similar to jit.gl.sketch); > > #P comment 383 359 244 196617 targetname > attributes>; > > #P newex 224 400 54 196617 s multiple; > > #P toggle 224 359 15 0; > > #P message 224 381 76 196617 targetmode $1; > > #P newex 138 248 41 196617 s draw; > > #P newex 315 148 56 196617 r loadbang; > > #P newex 143 414 56 196617 s loadbang; > > #P newex 532 319 32 196617 print; > > #P newex 220 215 54 196617 r multiple; > > #P newex 125 385 48 196617 loadbang; > > #P message 232 250 65 196617 getglparams; > > #P user jit.fpsgui 118 270 60 196617 0; > > #P message 112 494 34 196617 reset; > > #P newex 112 513 255 196617 jit.gl.handle foo @inherit_transform 1 > > @auto_rotate 1; > > #P window setfont "Sans Serif" 18.; > > #P comment 94 94 136 196626 jit.gl.multiple; > > #P window setfont "Sans Serif" 9.; > > #P comment 94 119 251 196617 Use matrices to draw many instances of a gl > object; > > #P user panel 89 89 400 50; > > #X brgb 255 255 255; > > #X frgb 0 0 0; > > #X border 0; > > #X rounded 0; > > #X shadow 0; > > #X done; > > #P toggle 536 513 15 0; > > #P message 536 531 55 196617 floating $1; > > #P toggle 463 513 15 0; > > #P newex 424 512 35 196617 sel 27; > > #P message 463 531 68 196617 fullscreen $1; > > #P newex 381 555 188 196617 jit.window foo @depthbuffer 1 @sync 0; > > #P newex 379 512 40 196617 key; > > #P number 135 166 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0; > > #P toggle 94 166 15 0; > > #P newex 94 188 51 196617 qmetro 2; > > #P newex 94 210 58 196617 t b b erase; > > #P newex 94 555 271 196617 jit.gl.render foo @erase_color 1. 1. 1. 1. > > @camera 0 0 -6; > > #P button 125 413 15 0; > > #P button 315 169 15 0; > > #P window linecount 2; > > #P newex 125 439 404 196617 jit.gl.gridshape foo @shape torus > > @lighting_enable 1 @blend_enable 1 @smooth_shading 1 @automatic 0 > > @depth_enable 1 @dim 10 10 @name me @color 1 0 0 1; > > #P newex 306 285 227 196617 jit.gl.multiple foo 2 @targetname me > > @glparams position color; > > #B color 5; > > #P window linecount 1; > > #P comment 245 359 125 196617 > > #P connect 4 0 2 0; > > #P connect 6 1 22 0; > > #P fasten 6 1 29 0 123 242 143 242; > > #P connect 6 1 36 0; > > #P connect 37 0 36 0; > > #P connect 36 0 39 0; > > #P connect 39 0 1 1; > > #P connect 39 0 38 0; > > #P connect 16 0 15 0; > > #P fasten 1 1 26 0 528 318 537 318; > > #P connect 14 0 12 0; > > #P fasten 13 0 14 0 429 530 460 530 460 510 468 510; > > #P fasten 10 0 13 0 384 531 421 531 421 510 429 510; > > #P fasten 12 0 11 0 468 550 386 550; > > #P fasten 15 0 11 0 541 550 386 550; > > #P connect 28 0 3 0; > > #P connect 40 0 41 0; > > #P connect 3 0 40 0; > > #P fasten 25 0 1 0 225 281 311 281; > > #P fasten 23 0 1 0 237 281 311 281; > > #P fasten 35 0 1 0 305 291; > > #P connect 41 0 1 0; > > #P connect 30 0 32 0; > > #P connect 31 0 30 0; > > #P connect 24 0 4 0; > > #P fasten 24 0 27 0 130 408 148 408; > > #P connect 9 0 7 1; > > #P connect 21 0 20 0; > > #P connect 6 0 5 0; > > #P fasten 6 2 5 0 147 233 99 233; > > #P fasten 20 0 5 0 117 542 99 542; > > #P connect 7 0 6 0; > > #P connect 8 0 7 0; > > #P window clipboard copycount 42; > > > > > > >