fading between jit.gl objects that don't accept [matrixout 1]????

Sep 19, 2007 at 5:40pm

fading between jit.gl objects that don't accept [matrixout 1]????

I am looking for a way to change one opengl scene to another but can’t
find a way of removing opengl content to make way for anything new. For
example, I can easily xfade out old stuff with those gl objects that
accept a [matrixout 1] message, but for those that don’t, like
jit.gl.gridshape or jit.gl.mesh, there doesn’t seem to be a way.

Any ideas? Many thanks, Robbie.

#33738
Sep 19, 2007 at 5:46pm

with @blend_enable 1, fade the alpha color of the departing object to 0.

On Sep 19, 2007, at 1:40 PM, Robbie Byron wrote:

> I am looking for a way to change one opengl scene to another but
> can’t find a way of removing opengl content to make way for
> anything new. For example, I can easily xfade out old stuff with
> those gl objects that accept a [matrixout 1] message, but for those
> that don’t, like jit.gl.gridshape or jit.gl.mesh, there doesn’t
> seem to be a way.
>
> Any ideas? Many thanks, Robbie.
>

#112784
Sep 19, 2007 at 6:03pm

On Sep 19, 2007, at 10:46 AM, joshua goldberg wrote:

> with @blend_enable 1, fade the alpha color of the departing object
> to 0.

Caveat: This is sensitive to @depth_enable which is on by default…

Otherwise render to texture and crossfade two videoplanes, which is
tricky, but there are some examples on the list that may be of
assistance.

-Joshua

#112785
Oct 20, 2007 at 5:15pm

I am trying to fade out jit.gl.nurbs, without using the
matrixoutput/xfade option. As far as I can tell, the below patch should
fade out the nurbs when the alpha color message is brought to 0…. but
it doesn’t…..

Any ideas why? And if not, does anyone have any other ideas how to fade
out a jit.gl.nurbs scene from the renderer? Thanks! Robbie

#P window setfont “Sans Serif” 9.;
#P flonum 238 544 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P toggle 193 601 15 0;
#P window linecount 1;
#P message 193 619 55 196617 floating $1;
#P flonum 373 431 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P flonum 324 592 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P flonum 275 571 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P newex 253 618 117 196617 pak color 0.31 0.5 0.54;
#P flonum 501 519 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P flonum 463 519 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P flonum 423 519 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P newex 398 546 85 196617 pak scale 1. 1. 1.;
#P newex 367 641 50 196617 s nurby1;
#P flonum 520 567 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P flonum 482 567 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P flonum 442 567 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P newex 414 591 95 196617 pak position 0. 0. 0.;
#P toggle 111 600 15 0;
#P newex 72 599 35 196617 sel 27;
#P message 111 618 68 196617 fullscreen $1;
#P newex 29 642 194 196617 jit.window foo @depthbuffer 1 @interp 1;
#P newex 27 599 40 196617 key;
#P number 533 269 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P message 533 287 63 196617 order $1 $1;
#P number 478 269 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P message 478 287 54 196617 dim $1 $1;
#P newex 427 286 50 196617 r nurby1;
#P number 395 222 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P message 395 243 54 196617 dim $1 $1;
#P button 334 239 15 0;
#P newex 334 266 110 196617 jit.noise 3 float32 8 8;
#P newex 257 169 43 196617 jit.qball;
#P number 302 131 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P toggle 257 123 15 0;
#P newex 257 149 55 196617 metro 20;
#P newex 257 189 66 196617 t b erase b b;
#P window linecount 2;
#P newex 334 313 236 196617 jit.gl.nurbs foo @smooth_shading 1
@blend_enable 1 @depth_enable 1 @lighting_enable 1;
#P window linecount 1;
#P newex 257 358 80 196617 jit.gl.render foo;
#P newex 334 286 89 196617 prepend ctlmatrix;
#P window linecount 4;
#P comment 418 433 100 196617 if this (the alpha channel) is 0. shoudlnt
the nurb disappear?;
#P user panel 363 420 171 72;
#X brgb 191 191 191;
#X frgb 0 0 0;
#X border 1;
#X rounded 0;
#X shadow 0;
#X done;
#P fasten 21 0 20 0 116 637 34 637;
#P fasten 37 0 20 0 198 637 34 637;
#P fasten 19 0 22 0 32 618 69 618 69 597 77 597;
#P fasten 22 0 23 0 77 617 108 617 108 597 116 597;
#P connect 23 0 21 0;
#P connect 38 0 37 0;
#P connect 39 0 33 0;
#P connect 7 0 6 0;
#P connect 6 0 9 0;
#P connect 9 0 5 0;
#P connect 5 0 3 0;
#P fasten 5 1 3 0 280 221 262 221;
#P fasten 4 0 3 0 339 350 262 350;
#P connect 34 0 33 1;
#P connect 8 0 6 1;
#P fasten 35 0 33 2 329 612 328 612;
#P fasten 5 2 11 0 298 222 339 222;
#P connect 11 0 10 0;
#P fasten 12 0 10 0 400 262 339 262;
#P connect 10 0 2 0;
#P connect 2 0 4 0;
#P fasten 14 0 4 0 432 306 339 306;
#P fasten 17 0 4 0 538 309 339 309;
#P fasten 15 0 4 0 483 309 339 309;
#P fasten 36 0 33 3 378 612 363 612;
#P fasten 33 0 28 0 258 638 372 638;
#P fasten 29 0 28 0 403 636 372 636;
#P fasten 24 0 28 0 419 636 372 636;
#P connect 13 0 12 0;
#P connect 30 0 29 1;
#P connect 25 0 24 1;
#P fasten 31 0 29 2 468 540 453 540;
#P fasten 26 0 24 2 487 586 475 586;
#P fasten 32 0 29 3 506 540 478 540;
#P connect 16 0 15 0;
#P fasten 27 0 24 3 525 586 503 586;
#P connect 18 0 17 0;
#P window clipboard copycount 40;
>
>

#112786
Oct 20, 2007 at 6:01pm

Your pack color is wrong add one more 0. inside pack as shown inside
the corrected patch
max v2;
#N vpatcher 136 97 1143 835;
#P origin 0 102;
#P window setfont “Sans Serif” 9.;
#P flonum 410 529 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P toggle 253 559 15 0;
#P window linecount 1;
#P message 253 577 55 196617 floating $1;
#P flonum 433 389 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P flonum 372 529 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P flonum 335 529 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P newex 313 576 129 196617 pak color 0.31 0.5 0.54 0.;
#P flonum 561 477 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P flonum 523 477 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P flonum 483 477 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P newex 458 504 85 196617 pak scale 1. 1. 1.;
#P newex 427 599 50 196617 s nurby1;
#P flonum 580 525 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P flonum 542 525 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P flonum 502 525 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P newex 474 549 95 196617 pak position 0. 0. 0.;
#P toggle 171 558 15 0;
#P newex 132 557 35 196617 sel 27;
#P message 171 576 68 196617 fullscreen $1;
#P newex 89 600 194 196617 jit.window foo @depthbuffer 1 @interp 1;
#P newex 87 557 40 196617 key;
#P number 593 227 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P message 593 245 63 196617 order $1 $1;
#P number 538 227 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P message 538 245 54 196617 dim $1 $1;
#P newex 487 244 50 196617 r nurby1;
#P number 455 180 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P message 455 201 54 196617 dim $1 $1;
#P button 394 197 15 0;
#P newex 394 224 110 196617 jit.noise 3 float32 8 8;
#P newex 317 127 43 196617 jit.qball;
#P number 362 89 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P toggle 317 81 15 0;
#P newex 317 107 55 196617 metro 20;
#P newex 317 147 66 196617 t b erase b b;
#P window linecount 2;
#P newex 394 271 236 196617 jit.gl.nurbs foo @smooth_shading 1
@blend_enable 1 @depth_enable 1 @lighting_enable 1;
#P window linecount 1;
#P newex 317 316 80 196617 jit.gl.render foo;
#P newex 394 244 89 196617 prepend ctlmatrix;
#P window linecount 4;
#P comment 478 391 100 196617 if this (the alpha channel) is 0.
shoudlnt the nurb disappear?;
#P user panel 423 378 171 72;
#X brgb 191 191 191;
#X frgb 0 0 0;
#X border 1;
#X rounded 0;
#X shadow 0;
#X done;
#P fasten 37 0 20 0 258 595 94 595;
#P fasten 21 0 20 0 176 595 94 595;
#P fasten 19 0 22 0 92 576 129 576 129 555 137 555;
#P fasten 22 0 23 0 137 575 168 575 168 555 176 555;
#P connect 23 0 21 0;
#P connect 38 0 37 0;
#P connect 7 0 6 0;
#P connect 6 0 9 0;
#P connect 9 0 5 0;
#P fasten 4 0 3 0 399 308 322 308;
#P fasten 5 1 3 0 340 179 322 179;
#P connect 5 0 3 0;
#P connect 34 0 33 1;
#P connect 8 0 6 1;
#P fasten 35 0 33 2 377 570 388 570;
#P fasten 5 2 11 0 358 180 399 180;
#P fasten 12 0 10 0 460 220 399 220;
#P connect 11 0 10 0;
#P connect 10 0 2 0;
#P fasten 15 0 4 0 543 267 399 267;
#P fasten 17 0 4 0 598 267 399 267;
#P fasten 14 0 4 0 492 264 399 264;
#P connect 2 0 4 0;
#P connect 39 0 33 3;
#P fasten 33 0 28 0 318 596 432 596;
#P fasten 24 0 28 0 479 594 432 594;
#P fasten 29 0 28 0 463 594 432 594;
#P connect 36 0 33 4;
#P connect 13 0 12 0;
#P connect 30 0 29 1;
#P connect 25 0 24 1;
#P fasten 31 0 29 2 528 498 513 498;
#P fasten 26 0 24 2 547 544 535 544;
#P fasten 32 0 29 3 566 498 538 498;
#P connect 16 0 15 0;
#P fasten 27 0 24 3 585 544 563 544;
#P connect 18 0 17 0;
#P pop;

#112787
Oct 20, 2007 at 6:04pm

There problem is with pak. It should be “pak color 1. 1. 1. 1.” which
will give 5 inlets. The first inlet will change “color,” 2-4 will be
R, G, B values, and the last will be alpha. As of right now, you’re
not sending any alpha values. (Patch below)

Keith

#P origin 0 -453;
#P window setfont “Sans Serif” 9.;
#P flonum 285 442 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P toggle 240 499 15 0;
#P window linecount 1;
#P message 240 517 55 196617 floating $1;
#P flonum 420 329 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P flonum 371 490 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P flonum 322 469 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P newex 300 516 129 196617 pak color 0.31 0.5 0.54 0.;
#P flonum 548 417 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P flonum 510 417 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P flonum 470 417 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P newex 445 444 85 196617 pak scale 1. 1. 1.;
#P newex 414 539 50 196617 s nurby1;
#P flonum 567 465 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P flonum 529 465 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P flonum 489 465 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P newex 461 489 95 196617 pak position 0. 0. 0.;
#P toggle 158 498 15 0;
#P newex 119 497 35 196617 sel 27;
#P message 158 516 68 196617 fullscreen $1;
#P newex 76 540 194 196617 jit.window foo @depthbuffer 1 @interp 1;
#P newex 74 497 40 196617 key;
#P number 580 167 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P message 580 185 63 196617 order $1 $1;
#P number 525 167 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P message 525 185 54 196617 dim $1 $1;
#P newex 474 184 50 196617 r nurby1;
#P number 442 120 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P message 442 141 54 196617 dim $1 $1;
#P button 381 137 15 0;
#P newex 381 164 110 196617 jit.noise 3 float32 8 8;
#P newex 304 67 43 196617 jit.qball;
#P number 349 29 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P toggle 304 21 15 0;
#P newex 304 47 55 196617 metro 20;
#P newex 304 87 66 196617 t b erase b b;
#P window linecount 2;
#P newex 381 211 236 196617 jit.gl.nurbs foo @smooth_shading 1
@blend_enable 1 @depth_enable 1 @lighting_enable 1;
#P window linecount 1;
#P newex 304 256 80 196617 jit.gl.render foo;
#P newex 381 184 89 196617 prepend ctlmatrix;
#P comment 465 331 100 196617 it was pak’s fault!;
#P user panel 410 318 171 72;
#X brgb 191 191 191;
#X frgb 0 0 0;
#X border 1;
#X rounded 0;
#X shadow 0;
#X done;
#P fasten 37 0 20 0 245 535 81 535;
#P fasten 21 0 20 0 163 535 81 535;
#P fasten 19 0 22 0 79 516 116 516 116 495 124 495;
#P fasten 22 0 23 0 124 515 155 515 155 495 163 495;
#P connect 23 0 21 0;
#P connect 38 0 37 0;
#P connect 7 0 6 0;
#P connect 6 0 9 0;
#P connect 9 0 5 0;
#P fasten 4 0 3 0 386 248 309 248;
#P fasten 5 1 3 0 327 119 309 119;
#P connect 5 0 3 0;
#P connect 39 0 33 1;
#P connect 8 0 6 1;
#P connect 34 0 33 2;
#P fasten 5 2 11 0 345 120 386 120;
#P fasten 12 0 10 0 447 160 386 160;
#P connect 11 0 10 0;
#P connect 10 0 2 0;
#P fasten 15 0 4 0 530 207 386 207;
#P fasten 17 0 4 0 585 207 386 207;
#P fasten 14 0 4 0 479 204 386 204;
#P connect 2 0 4 0;
#P connect 35 0 33 3;
#P fasten 33 0 28 0 305 536 419 536;
#P fasten 24 0 28 0 466 534 419 534;
#P fasten 29 0 28 0 450 534 419 534;
#P connect 36 0 33 4;
#P connect 13 0 12 0;
#P connect 30 0 29 1;
#P connect 25 0 24 1;
#P fasten 31 0 29 2 515 438 500 438;
#P fasten 26 0 24 2 534 484 522 484;
#P fasten 32 0 29 3 553 438 525 438;
#P connect 16 0 15 0;
#P fasten 27 0 24 3 572 484 550 484;
#P connect 18 0 17 0;

On 10/20/07, Robbie Byron wrote:
> I am trying to fade out jit.gl.nurbs, without using the
> matrixoutput/xfade option. As far as I can tell, the below patch should
> fade out the nurbs when the alpha color message is brought to 0…. but
> it doesn’t…..
>
> Any ideas why? And if not, does anyone have any other ideas how to fade
> out a jit.gl.nurbs scene from the renderer? Thanks! Robbie
>
> #P window setfont “Sans Serif” 9.;
> #P flonum 238 544 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
> #P toggle 193 601 15 0;
> #P window linecount 1;
> #P message 193 619 55 196617 floating $1;
> #P flonum 373 431 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
> #P flonum 324 592 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
> #P flonum 275 571 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
> #P newex 253 618 117 196617 pak color 0.31 0.5 0.54;
> #P flonum 501 519 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
> #P flonum 463 519 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
> #P flonum 423 519 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
> #P newex 398 546 85 196617 pak scale 1. 1. 1.;
> #P newex 367 641 50 196617 s nurby1;
> #P flonum 520 567 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
> #P flonum 482 567 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
> #P flonum 442 567 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
> #P newex 414 591 95 196617 pak position 0. 0. 0.;
> #P toggle 111 600 15 0;
> #P newex 72 599 35 196617 sel 27;
> #P message 111 618 68 196617 fullscreen $1;
> #P newex 29 642 194 196617 jit.window foo @depthbuffer 1 @interp 1;
> #P newex 27 599 40 196617 key;
> #P number 533 269 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
> #P message 533 287 63 196617 order $1 $1;
> #P number 478 269 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
> #P message 478 287 54 196617 dim $1 $1;
> #P newex 427 286 50 196617 r nurby1;
> #P number 395 222 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
> #P message 395 243 54 196617 dim $1 $1;
> #P button 334 239 15 0;
> #P newex 334 266 110 196617 jit.noise 3 float32 8 8;
> #P newex 257 169 43 196617 jit.qball;
> #P number 302 131 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
> #P toggle 257 123 15 0;
> #P newex 257 149 55 196617 metro 20;
> #P newex 257 189 66 196617 t b erase b b;
> #P window linecount 2;
> #P newex 334 313 236 196617 jit.gl.nurbs foo @smooth_shading 1
> @blend_enable 1 @depth_enable 1 @lighting_enable 1;
> #P window linecount 1;
> #P newex 257 358 80 196617 jit.gl.render foo;
> #P newex 334 286 89 196617 prepend ctlmatrix;
> #P window linecount 4;
> #P comment 418 433 100 196617 if this (the alpha channel) is 0. shoudlnt
> the nurb disappear?;
> #P user panel 363 420 171 72;
> #X brgb 191 191 191;
> #X frgb 0 0 0;
> #X border 1;
> #X rounded 0;
> #X shadow 0;
> #X done;
> #P fasten 21 0 20 0 116 637 34 637;
> #P fasten 37 0 20 0 198 637 34 637;
> #P fasten 19 0 22 0 32 618 69 618 69 597 77 597;
> #P fasten 22 0 23 0 77 617 108 617 108 597 116 597;
> #P connect 23 0 21 0;
> #P connect 38 0 37 0;
> #P connect 39 0 33 0;
> #P connect 7 0 6 0;
> #P connect 6 0 9 0;
> #P connect 9 0 5 0;
> #P connect 5 0 3 0;
> #P fasten 5 1 3 0 280 221 262 221;
> #P fasten 4 0 3 0 339 350 262 350;
> #P connect 34 0 33 1;
> #P connect 8 0 6 1;
> #P fasten 35 0 33 2 329 612 328 612;
> #P fasten 5 2 11 0 298 222 339 222;
> #P connect 11 0 10 0;
> #P fasten 12 0 10 0 400 262 339 262;
> #P connect 10 0 2 0;
> #P connect 2 0 4 0;
> #P fasten 14 0 4 0 432 306 339 306;
> #P fasten 17 0 4 0 538 309 339 309;
> #P fasten 15 0 4 0 483 309 339 309;
> #P fasten 36 0 33 3 378 612 363 612;
> #P fasten 33 0 28 0 258 638 372 638;
> #P fasten 29 0 28 0 403 636 372 636;
> #P fasten 24 0 28 0 419 636 372 636;
> #P connect 13 0 12 0;
> #P connect 30 0 29 1;
> #P connect 25 0 24 1;
> #P fasten 31 0 29 2 468 540 453 540;
> #P fasten 26 0 24 2 487 586 475 586;
> #P fasten 32 0 29 3 506 540 478 540;
> #P connect 16 0 15 0;
> #P fasten 27 0 24 3 525 586 503 586;
> #P connect 18 0 17 0;
> #P window clipboard copycount 40;
> >
> >
>

#112788
Nov 14, 2007 at 8:14pm

hi

If your using a jit.gl.sketch instead of nurbs this way of fading does not seem to work i.e. fading the sketch out. How do you make gl shapes that have been drawn into a sketch fade out?

a+
gar

#112789
Nov 14, 2007 at 10:40pm

enable blend_enable on the gl.sketch and use the message glcolor r g b a before drawing your shapes

#112790

You must be logged in to reply to this topic.