Hi, I need to project a certain rectangle/quadrangle with a videobeamer. It is a distorted and non 4:3 area. I wonder if it possible to render the gembuffer into such a polygon. The rest of the screen should remain black. So I know how to render images and videos into that area, but I didn't find an easy solution to texture/snap the whole gemwindow into that rectangle. I would like to have some particle effects. the only way I can think of is using single buffer mode and pix_snap a buffer, then clear it and then texture onto my polygon. Do you have other ideas? thank you. marius.
marius schebella wrote:
Hi, I need to project a certain rectangle/quadrangle with a videobeamer. It is a distorted and non 4:3 area. I wonder if it possible to render the gembuffer into such a polygon. The rest of the screen should remain black. So I know how to render images and videos into that area, but I didn't find an easy solution to texture/snap the whole gemwindow into that rectangle. I would like to have some particle effects. the only way I can think of is using single buffer mode and pix_snap a buffer, then clear it and then texture onto my polygon. Do you have other ideas? thank you. marius.
you could do it in double-buffered mode as well if you make sure that the rectangle to texture on is just before everything else (and you would probably want a 2nd rectangle that guarantees that the edges beyond your texture-geo are still black. render order is important.
mfg.asdr. IOhannes
IOhannes m zmoelnig wrote:
you could do it in double-buffered mode as well if you make sure that the rectangle to texture on is just before everything else (and you would probably want a 2nd rectangle that guarantees that the edges beyond your texture-geo are still black. render order is important.
just for illustration. when the surface does not bend in the z-dimension, you will get less problems with the original scene getting through
mfg.asd.r IOhannes
#N canvas 416 113 600 500 10; #X obj 40 165 gemwin; #N canvas 87 154 247 179 Gem.init 0; #X obj 118 46 loadbang; #X obj 118 113 outlet; #X msg 118 81 reset , lighting 1; #X connect 0 0 2 0; #X connect 2 0 1 0; #X restore 95 131 pd Gem.init; #X msg 40 97 create , 1; #N canvas 0 0 683 523 particles 0; #X obj 198 50 gemhead; #X obj 198 82 part_head; #X obj 198 136 part_color; #X text 329 37 set the color range; #X text 299 174 set the size; #X text 310 269 set the number per frame; #X text 310 378 set the age to kill at; #X text 414 196 the velocity domain; #X msg 219 413 draw line; #X msg 298 413 draw point; #X obj 198 270 part_source 25; #X obj 198 381 part_killold 45; #X text 412 230 radius = 0.2; #X msg 336 97 1 0 1; #X msg 396 98 0 1 0; #X obj 198 220 part_velocity sphere 0 0 0 0.2; #X floatatom 375 301 0 0 0 0 - - -; #X obj 198 334 part_orbitpoint 0 1 0 0.08; #X text 390 333 orbit point and gravity; #X obj 198 174 part_size 0.4; #X obj 360 61 loadbang; #X text 411 213 a sphere at 0 0 0; #X text 415 299 keep the gravity low; #X obj 198 447 part_render; #X obj 200 474 cube 0.1; #X obj 197 28 tgl 15 0 empty empty empty 0 -6 0 8 -262144 -1 -1 0 1 ; #X obj 48 84 gemhead; #X obj 55 125 color 1 1 0; #X obj 57 162 teapot; #X connect 0 0 1 0; #X connect 1 0 2 0; #X connect 2 0 19 0; #X connect 8 0 24 0; #X connect 10 0 17 0; #X connect 11 0 23 0; #X connect 13 0 2 1; #X connect 14 0 2 2; #X connect 15 0 10 0; #X connect 16 0 17 2; #X connect 17 0 11 0; #X connect 19 0 15 0; #X connect 20 0 14 0; #X connect 20 0 13 0; #X connect 23 0 24 0; #X connect 25 0 0 0; #X connect 26 0 27 0; #X connect 27 0 28 0; #X restore 296 74 pd particles; #X obj 274 176 gemhead -1; #X obj 274 229 t a b; #X obj 274 257 pix_snap2tex; #X floatatom 435 341 5 0 0 2 height - -; #X floatatom 308 305 5 0 0 0 - - -; #X floatatom 341 305 5 0 0 0 - - -; #X floatatom 375 305 5 0 0 0 - - -; #X msg 435 302 0.06; #X obj 435 274 loadbang; #X msg 434 358 height $1; #X obj 276 387 newWave 50; #X obj 274 330 rotateXYZ 300 0 0; #X obj 276 348 t a b; #X floatatom 355 394 5 0 0 0 - - -; #X floatatom 364 183 5 0 0 0 - - -; #X msg 321 231 0 0; #X msg 353 234 500 500; #X obj 36 375 gemhead; #X obj 36 402 world_light; #X msg 421 421 mode 5; #X obj 274 204 translateXYZ 0 0 1.2; #X connect 1 0 0 0; #X connect 2 0 0 0; #X connect 4 0 24 0; #X connect 5 0 6 0; #X connect 5 1 6 0; #X connect 6 0 15 0; #X connect 7 0 13 0; #X connect 8 0 15 1; #X connect 9 0 15 2; #X connect 10 0 15 3; #X connect 11 0 7 0; #X connect 12 0 11 0; #X connect 13 0 14 0; #X connect 15 0 16 0; #X connect 16 0 14 0; #X connect 16 1 14 0; #X connect 17 0 14 1; #X connect 18 0 24 3; #X connect 19 0 6 1; #X connect 20 0 6 2; #X connect 21 0 22 0; #X connect 23 0 14 0; #X connect 24 0 5 0;