[PD] Keystone correction

Charles Goyard cg at fsck.fr
Tue Mar 27 11:21:27 CEST 2012


Hi Cyrille,

Cyrille Henry wrote:
> 
> you have to manually adjust the position of the 4 vertices defining
> the corned of the primitive in order to spacially adjust them.
> then, you have to adjust the position of the teture in this point
> (it's an option that you don't really need).  here it is adjusted in a
> neutral position.

Now, I have something almost working. The only thing is that my texture
gets folded along a diagonal when I move the polygon vertices. Drawing
the polygon as line shows the right trapeze.

Also I don't understand why I need to rotate my texture along the Z axis
to get it right.

Attached is my patch, a sample texture and what I get on my screen.
Please tell me what I did wrong.

I use gem 0.93.3.

Thanks,

BTW we might meet tonight at Clement's :)

-- 
Charles
-------------- next part --------------
#N canvas 2 47 1020 719 10;
#X msg 98 586 create;
#X msg 35 559 destroy;
#X msg 153 584 1;
#X obj 96 557 trigger b b b b b;
#X msg 199 584 0;
#X obj 17 123 translateXYZ;
#X obj 16 288 scaleXYZ;
#X floatatom 40 264 5 -200 200 0 - - -;
#X obj 382 306 polygon 4;
#X obj 96 536 bng 15 250 50 0 empty empty empty 17 7 0 10 -262144 -1
-1;
#X obj 104 625 gemwin 15;
#X obj 17 84 gemframebuffer;
#X obj 382 210 pix_texture;
#X obj 17 52 gemhead 1;
#X obj 382 176 gemhead;
#X obj 174 33 bng 15 250 50 0 empty empty empty 17 7 0 10 -262144 -1
-1;
#X msg 71 103 -4;
#X obj 16 346 circle;
#X obj 108 30 loadbang;
#X obj 16 316 pix_texture;
#X obj 382 259 translateXYZ;
#X msg 88 54 dimen 256 256;
#X obj 16 153 pix_image keystone.png;
#X msg 5 588 dimen 400 300;
#X obj 492 208 loadbang;
#X obj 22 447 translateXYZ;
#X floatatom 525 100 5 0 0 0 - - -;
#X msg 593 277 \$1 5 0;
#X msg 442 127 draw line;
#X msg 652 279 \$1 -5 0;
#X msg 441 102 draw fill;
#X obj 16 211 rotateXYZ;
#X msg 67 180 -90;
#X msg 520 278 \$1 5 0;
#X obj 731 171 - 5;
#X obj 762 170 expr 5 - $f1;
#X floatatom 527 129 5 0 0 0 - - -;
#X obj 674 203 - 5;
#X obj 684 236 expr 5 - $f1;
#X msg 468 279 \$1 -5 0;
#X obj 22 489 rectangle 20 20;
#X obj 91 403 loadbang;
#X obj 22 403 gemhead 2;
#X msg 91 425 -3;
#X msg 451 234 -2;
#X obj 97 106 s tex;
#X obj 446 187 r tex;
#X msg 40 240 4;
#X text 38 11 texture creation stuff;
#X obj 22 468 color 0.2 0.4 0.2;
#X text 13 380 non-black background to clearly see shapes;
#X text 563 98 this changes the top line of the polygon;
#X text 563 129 this changes the bottom line of he polygon;
#X text 79 210 i don't understand why I need to rotate;
#X connect 0 0 10 0;
#X connect 1 0 10 0;
#X connect 2 0 10 0;
#X connect 3 0 2 0;
#X connect 3 1 0 0;
#X connect 3 2 23 0;
#X connect 3 3 1 0;
#X connect 3 4 4 0;
#X connect 4 0 10 0;
#X connect 5 0 22 0;
#X connect 6 0 19 0;
#X connect 7 0 6 1;
#X connect 7 0 6 2;
#X connect 9 0 3 0;
#X connect 11 0 5 0;
#X connect 11 1 45 0;
#X connect 12 0 20 0;
#X connect 13 0 11 0;
#X connect 14 0 12 0;
#X connect 15 0 21 0;
#X connect 15 0 16 0;
#X connect 15 0 47 0;
#X connect 15 0 32 0;
#X connect 16 0 5 3;
#X connect 18 0 15 0;
#X connect 19 0 17 0;
#X connect 20 0 8 0;
#X connect 21 0 11 0;
#X connect 22 0 31 0;
#X connect 23 0 10 0;
#X connect 24 0 44 0;
#X connect 24 0 26 0;
#X connect 24 0 36 0;
#X connect 25 0 49 0;
#X connect 26 0 34 0;
#X connect 26 0 35 0;
#X connect 27 0 8 3;
#X connect 28 0 8 0;
#X connect 29 0 8 4;
#X connect 30 0 8 0;
#X connect 31 0 6 0;
#X connect 32 0 31 3;
#X connect 33 0 8 2;
#X connect 34 0 33 0;
#X connect 35 0 27 0;
#X connect 36 0 37 0;
#X connect 36 0 38 0;
#X connect 37 0 39 0;
#X connect 38 0 29 0;
#X connect 39 0 8 1;
#X connect 41 0 43 0;
#X connect 42 0 25 0;
#X connect 43 0 25 3;
#X connect 44 0 20 3;
#X connect 46 0 12 1;
#X connect 47 0 7 0;
#X connect 49 0 40 0;
-------------- next part --------------
A non-text attachment was scrubbed...
Name: keystone.png
Type: image/png
Size: 2424 bytes
Desc: not available
URL: <http://lists.puredata.info/pipermail/pd-list/attachments/20120327/e1c17695/attachment-0002.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: screenshot.png
Type: image/png
Size: 47753 bytes
Desc: not available
URL: <http://lists.puredata.info/pipermail/pd-list/attachments/20120327/e1c17695/attachment-0003.png>


More information about the Pd-list mailing list