From 480b757207c659f0c3e06277e29733b52d46bcdc Mon Sep 17 00:00:00 2001 From: Hans-Christoph Steiner Date: Wed, 13 Apr 2005 03:47:20 +0000 Subject: - created a suite of hid objects for using polar coordinates and converting between the range of 0-1 and degrees/radians. - made two joystick/polar examples - added some pretty colors to help patches svn path=/trunk/externals/hcs/hid/; revision=2754 --- hid_polar.pd | 39 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) create mode 100644 hid_polar.pd (limited to 'hid_polar.pd') diff --git a/hid_polar.pd b/hid_polar.pd new file mode 100644 index 0000000..5b28852 --- /dev/null +++ b/hid_polar.pd @@ -0,0 +1,39 @@ +#N canvas 328 234 464 407 10; +#X obj 30 58 inlet; +#X obj 25 323 outlet; +#X text 73 323 output range: 0 to 1; +#X text 72 57 input range: 0 to 1; +#X text 11 5 [hid_polar]; +#X obj 232 322 outlet; +#X obj 224 56 inlet; +#X text 264 57 input range: 0 to 1; +#X text 29 29 x-axis value; +#X text 221 26 y-axis value; +#X obj 25 292 / 1.41421; +#X text 92 292 (sqrt 2); +#X obj 104 220 cart2pol; +#X obj 223 85 t b f; +#X obj 29 180 f; +#X obj 252 140 - 1; +#X obj 252 120 * 2; +#X obj 29 140 - 1; +#X obj 29 120 * 2; +#X text 61 125 convert range to -1 to 1; +#X text 280 322 output range: 0 to 1; +#X text 245 371 released under the GNU GPL; +#X text 28 357 (C) Copyright 2005 Hans-Christoph Steiner +; +#X obj 231 290 rad2hid; +#X connect 0 0 18 0; +#X connect 6 0 13 0; +#X connect 10 0 1 0; +#X connect 12 0 10 0; +#X connect 12 1 23 0; +#X connect 13 0 14 0; +#X connect 13 1 16 0; +#X connect 14 0 12 0; +#X connect 15 0 12 1; +#X connect 16 0 15 0; +#X connect 17 0 14 0; +#X connect 18 0 17 0; +#X connect 23 0 5 0; -- cgit v1.2.1