#N canvas 112 41 475 596 10; #X text 24 22 Fantastick; #X text 24 41 http://pinktwins.com/fantastick; #N canvas 0 22 776 463 Connection 0; #X obj 53 112 route IP; #X obj 53 306 netsend 1; #X obj 53 212 symbol; #X text 343 49 Listen to Fantastick on UDP port 6661; #X msg 53 238 connect \$1 6662 \, send opengl 0; #X text 345 111 On startup \, FS sends its IP address with the prefix "IP".; #X text 345 125 Make that our destination address.; #X obj 200 162 route B M S E A X V; #X text 345 156 The prefixes B M S and E correspond to begin \, move \, stationary and end \, for type of multitouch event.; #X text 346 190 Data format for each touch point is "type x y id"; #X text 347 227 After all touch positions \, a single X followed by number of touch points is transmitted. When all fingers are lifted off the screen \, "X 0" is transmitted.; #X text 346 277 Single "V" message indicates a volume button was pressed. ; #X obj 200 189 s Fantastick; #X obj 98 162 s rawFantastick; #X obj 263 214 s Accel; #X text 347 298 Prefix "A" is used for accelerometer data.; #X text 347 323 For these examples \, we are sending only the coordinates to receiver "Fantastick" \, and everything to "rawFantastick"; #X obj 295 379 bng 15 250 50 0 empty empty empty 17 7 0 10 -262144 -1 -1; #X obj 53 50 netreceive 6661 1; #X text 317 378 Volume button pressed; #X obj 64 183 bng 15 250 50 0 empty empty empty 17 7 0 10 -262144 -1 -1; #X obj 165 292 r toFantastick; #X obj 165 318 tosymbol; #X obj 165 344 prepend send; #X text 346 204 id is the finger number from 1 to 5; #X connect 0 0 2 0; #X connect 0 1 7 0; #X connect 0 1 13 0; #X connect 2 0 4 0; #X connect 4 0 1 0; #X connect 7 0 12 0; #X connect 7 1 12 0; #X connect 7 2 12 0; #X connect 7 3 12 0; #X connect 7 4 14 0; #X connect 7 6 17 0; #X connect 18 0 0 0; #X connect 20 0 2 0; #X connect 21 0 22 0; #X connect 22 0 23 0; #X connect 23 0 1 0; #X restore 27 88 pd Connection to iPhone/iPod; #X text 218 87 How to connect \, and about data format; #N canvas 0 22 436 337 Connection 0; #X obj 63 132 tgl 15 0 empty empty empty 17 7 0 10 -262144 -1 -1 1 1; #X obj 63 32 inlet; #X obj 63 68 tgl 15 0 empty empty empty 17 7 0 10 -262144 -1 -1 0 1 ; #X text 198 70 Simple connection test.; #X obj 63 161 sel 0 1; #X obj 63 260 s toFantastick; #X obj 63 96 metro 1000; #X msg 63 196 clear \, line 160 0 160 480 \, @; #X msg 82 226 clear \, line 0 240 320 240 \, @; #X connect 0 0 4 0; #X connect 1 0 2 0; #X connect 2 0 6 0; #X connect 4 0 7 0; #X connect 4 1 8 0; #X connect 6 0 0 0; #X connect 7 0 5 0; #X connect 8 0 5 0; #X restore 27 146 pd Connection test; #X obj 27 126 tgl 15 0 empty empty empty 17 7 0 10 -262144 -1 -1 0 1; #X text 219 147 Simple connection test; #X text 25 203 There are two drawing modes in Fantastick \, Quartz and OpenGL. See examples from both to decide which you find easier for your particular use.; #X text 27 263 Quartz drawing reference and examples; #X text 29 411 OpenGL drawing reference and examples; #N canvas 0 22 632 440 Drawing 0; #X obj 61 325 s toFantastick; #X msg 61 72 line 10 10 310 410 \, @; #X text 217 61 The basic drawing element \, line. Single @ character is used to draw previously sent commands. This eliminates flicker for consecutive clear and draw operations.; #X msg 87 127 rect 10 10 310 200 \, @; #X text 238 126 Draw filled rectangle.; #X msg 116 168 color 1 0 0; #X text 223 161 Set RGB colors for drawing. Click here and try drawing again.; #X msg 139 212 width 10; #X text 208 212 Set line width. Default is 2; #X msg 153 255 clear 20 20 300 190 \, @; #X text 310 255 Clear part of the screen.; #X msg 175 293 clear \, @; #X text 246 294 Clear all.; #X connect 1 0 0 0; #X connect 3 0 0 0; #X connect 5 0 0 0; #X connect 7 0 0 0; #X connect 9 0 0 0; #X connect 11 0 0 0; #X restore 27 283 pd Drawing; #N canvas 0 22 715 643 Images 0; #X obj 39 514 s toFantastick; #X text 224 62 Fetch image from web \, display it. Image is stored on the device permanently and can later be referred with its filename. ; #X text 226 110 Once fetched \, it can be loaded without a network connection by using the filename.; #X text 226 145 NOTE: once stored on the device \, using the full URL (http://...) will use the local copy as well. Use "clearimagecache" command to force fetching from web again.; #X text 293 212 Set image position.; #X text 323 247 Set image size.; #X msg 39 36 image http://pinktwins.com/fantastick/pulseplus2.jpg \, @; #X msg 56 117 image pulseplus2.jpg \, @; #X msg 93 246 set pulseplus2.jpg size 200 160 \, @; #X msg 73 212 set pulseplus2.jpg point 60 80 \, @; #X msg 115 286 set pulseplus2.jpg movable; #X text 298 281 Set movable flag. Click here and try dragging the image around...; #X text 244 337 <- after turning on this metro. The screen still updates only when @ is received.; #X obj 166 339 tgl 15 0 empty empty empty 17 7 0 10 -262144 -1 -1 0 1; #X obj 166 362 metro 40; #X msg 166 388 @; #X msg 176 432 set pulseplus2.jpg immovable; #X text 365 432 Turn off movable flag.; #X msg 192 473 clearimages \, @; #X text 294 473 Clear images from screen.; #X msg 191 515 clearimagecache; #X text 302 509 Clear the local image cache. Use this to force reloading images from web.; #X text 190 567 TURN OFF THE METRO before continuing to other examples! ; #X connect 6 0 0 0; #X connect 7 0 0 0; #X connect 8 0 0 0; #X connect 9 0 0 0; #X connect 10 0 0 0; #X connect 13 0 14 0; #X connect 14 0 15 0; #X connect 15 0 0 0; #X connect 16 0 0 0; #X connect 18 0 0 0; #X connect 20 0 0 0; #X restore 27 305 pd Images; #N canvas 10 34 508 575 Text 0; #X obj 22 280 s toFantastick; #X msg 75 68 text 50 200 Fantastick! \, @; #X text 261 67 Draw simple text.; #X msg 101 110 font Zapfino 40; #X text 262 109 Try different fonts...; #X text 127 144 Some iPhone/iPod fontnames are listed here: http://www.latenightcode.com/devblog/iphone-fonts ; #X text 115 203 Write at any angle \, useful for matching orientation. ; #X floatatom 191 232 5 0 0 0 - - -; #X msg 79 422 font Courier 20; #X msg 191 264 textangle \$1; #X obj 191 299 t b a; #X msg 174 339 text 160 300 Fantastick! \, @; #X msg 130 388 clear \, color 1 1 1 \, @; #X connect 1 0 0 0; #X connect 3 0 0 0; #X connect 7 0 9 0; #X connect 8 0 0 0; #X connect 9 0 10 0; #X connect 10 0 11 0; #X connect 10 1 0 0; #X connect 11 0 0 0; #X connect 12 0 0 0; #X restore 27 327 pd Text; #N canvas 0 22 727 679 Multislider 0; #N canvas 0 22 450 300 (subpatch) 0; #X array ms 20 float 0; #X coords 0 0 19 480 200 140 1; #X restore 345 113 graph; #X obj 84 81 r Fantastick; #X obj 51 277 f; #X obj 51 308 tabwrite ms; #X obj 51 160 / 320; #X obj 51 211 i; #X obj 51 185 * 20; #X obj 263 356 + 1; #X obj 223 325 t f f; #X floatatom 323 373 5 0 0 0 - - -; #X floatatom 357 373 5 0 0 0 - - -; #X obj 223 356 * 16; #X obj 263 381 * 16; #X obj 223 633 s toFantastick; #X msg 223 585 @; #X msg 342 631 clear \, @; #X text 29 18 Simple multislider example with 20 sliders.; #X obj 223 560 speedlim 80; #X text 135 106 Update table from input data; #X text 339 542 In Quartz \, screen refreshes are the slowest part. It's a good idea to limit them with speedlim. Try the OpenGL examples for much faster drawing.; #X text 238 299 Draw the user input with rect command; #X obj 223 535 t b a; #X msg 223 509 rect \$1 \$3 \$2 480; #X msg 250 483 clear \$1 0 \$2 480; #X obj 51 105 gate 0; #X obj 51 81 tgl 15 0 empty empty empty 17 7 0 10 -262144 -1 -1 1 1 ; #X text 48 55 Turn on the control...; #X obj 223 458 t l l; #X obj 223 429 pack f f f; #X obj 51 133 unpack f f; #X obj 51 245 t b f; #X connect 1 0 24 1; #X connect 2 0 3 0; #X connect 4 0 6 0; #X connect 5 0 8 0; #X connect 5 0 30 0; #X connect 6 0 5 0; #X connect 7 0 12 0; #X connect 8 0 11 0; #X connect 8 1 7 0; #X connect 11 0 9 0; #X connect 11 0 28 0; #X connect 12 0 10 0; #X connect 12 0 28 1; #X connect 14 0 13 0; #X connect 15 0 13 0; #X connect 17 0 14 0; #X connect 21 0 17 0; #X connect 21 1 13 0; #X connect 22 0 21 0; #X connect 23 0 13 0; #X connect 24 0 29 0; #X connect 25 0 24 0; #X connect 27 0 22 0; #X connect 27 1 23 0; #X connect 28 0 27 0; #X connect 29 0 4 0; #X connect 29 1 2 1; #X connect 29 1 28 2; #X connect 30 0 2 0; #X connect 30 1 3 1; #X restore 27 349 pd Multislider; #N canvas 0 22 567 451 OpenGL 0; #X text 98 135 Basic idea is to build very simple three dimensional models \, and build the interface from these models. Feedback is possible by either altering the model geometry \, or changing models' position \, scale or rotation.; #X text 98 53 OpenGL mode has an advanced set of drawing commands. Depending on the interface you are building \, it might be easier to implement with OpenGL. It's also faster! You can switch between the default Quartz mode and OpenGL mode easily.; #N canvas 0 22 725 715 Reference 0; #X text 22 27 OpenGL Reference. See the examples for practical usage. ; #X text 23 72 Building models \, properties; #X msg 23 98 model foo xyz 0 0 0 320 0 0; #X text 246 90 Create or update model named "foo" with two points (0 \, 0 \, 0) and (320 \, 0 \, 0); #X msg 24 130 model foo color 1 0 0 1; #X text 246 128 Set model "foo" color to red \, full alpha; #X msg 24 158 model foo width 10; #X text 246 157 Set model "foo" line width; #X msg 24 186 model foo position 160 240 0; #X text 246 182 Set model "foo" position; #X msg 24 219 model foo rotate 90 0 90 0; #X text 248 218 Set model "foo" rotation; #X msg 24 251 model foo scale 2 1 1; #X text 249 250 Set model "foo" scale; #X text 24 298 Drawing modes; #X msg 24 324 model foo render points; #X msg 24 352 model foo render lines; #X text 248 315 Render model with points or lines. Other rendering modes are: line_loop \, line_strip \, triangles \, triangle_strip \, triangle_fan; #X text 26 399 Images; #X msg 26 425 model bg image http://pinktwins.com/fantastick/pulseplus2.jpg ; #X text 338 429 Create model named "bg" with image texture.; #X text 338 454 NOTE: image width and height MUST be power of two! (2 \, 4 \, 8 \, 16 \, 32 \, 64 \, 128 \, 256 \, 512 or 1024).; #X text 337 496 Color \, position \, rotate and scale are all good with images too.; #X text 29 509 Text; #X msg 24 535 model t text Hello there! \, model t position 100 200 0; #X text 370 528 Create text model. Text is drawn above and to the right from model position.; #X msg 24 563 model t font Courier; #X msg 25 596 model t fontsize 48; #X text 370 566 Set font and size. In addition to these \, the position \, rotate \, scale and color messages can be used for text models as well.; #X text 33 637 Other; #X msg 25 661 clearmodels; #X text 346 656 Clear all models; #X restore 154 250 pd Reference; #N canvas 0 22 530 408 Examples 0; #X text 73 41 Examples using OpenGL drawing.; #X obj 75 99 tgl 15 0 empty empty empty 17 7 0 10 -262144 -1 -1 1 1 ; #X text 100 98 Turn on opengl drawing; #X msg 75 121 opengl \$1; #X obj 75 153 s toFantastick; #X obj 75 209 r off; #X obj 75 233 b; #X msg 75 257 clearmodels; #X obj 75 281 s toFantastick; #N canvas 0 22 830 780 Crosshair 0; #X text 56 31 HELP: Click on these message boxes \, and then on the "Enable touch" toggle. Try touching the device. Then \, click all the boxes on the lower part of the window.; #X obj 60 159 s toFantastick; #X msg 60 91 model x xyz 0 0 0 320 0 0; #X msg 73 126 model y xyz 0 0 0 0 480 0; #X text 282 120 Click here to create vertical line from (0 \, 0 \, 0 \, to (0 \, 480 \, 0); #X text 281 84 Click here to create horizontal line from (0 \, 0 \, 0) to (320 \, 0 \, 0); #X obj 60 219 tgl 15 0 empty empty empty 17 7 0 10 -262144 -1 -1 0 1; #X obj 60 195 r off; #X obj 81 247 r Fantastick; #X obj 60 273 gate; #X obj 76 438 s toFantastick; #X msg 152 326 model x position 0 \$1 0; #X msg 95 350 model y position \$1 0 0; #X text 306 325 Touch events update both lines \, creating a simple crosshair.; #X msg 60 374 model box position \$1 \$2 0; #X msg 60 403 model box2 position \$1 \$2 0; #X text 57 490 Click all these to add some extra; #X msg 55 513 model box xyz -50 -50 0 50 -50 0 50 50 0 -50 50 0 \, model box render line_loop; #X msg 55 551 model borders xyz 0 0 0 320 0 0 320 480 0 0 480 0 \, model borders render line_loop; #X msg 55 592 model box width 20 \, model box color 0.75 0.5 0.5 0.75 ; #X obj 55 621 s toFantastick; #X text 436 500 When creating a model \, don't focus on the screen dimensions (ie. 320x480) \, but think about where the center point of your model will be. When given a new position \, the model coordinates will be added to the position you provide. The "box" model here is an example. It's coordinates are from -50 to 50 \, which makes it 50 pixels away from the given position to all directions.; #X text 60 656 More extra... this one is slightly behind. True 3d! ; #X msg 55 680 model box2 xyz -50 -50 -150 50 -50 -150 50 50 -150 -50 50 -150 \, model box2 render triangle_fan \, model box2 color 1 1 1 0.3; #X obj 55 732 s toFantastick; #X text 434 601 That said \, in Fantastick OpenGL the upper left corner is (0 \, 0) and lower right is (320 \, 480) - identical to the reported touch positions.; #X text 81 218 Enable touch; #X obj 95 302 unpack f f; #X connect 2 0 1 0; #X connect 3 0 1 0; #X connect 6 0 9 0; #X connect 7 0 6 0; #X connect 8 0 9 1; #X connect 9 0 14 0; #X connect 9 0 15 0; #X connect 9 0 27 0; #X connect 11 0 10 0; #X connect 12 0 10 0; #X connect 14 0 10 0; #X connect 15 0 10 0; #X connect 17 0 20 0; #X connect 18 0 20 0; #X connect 19 0 20 0; #X connect 23 0 24 0; #X connect 27 0 12 0; #X connect 27 1 11 0; #X restore 317 99 pd Crosshair; #N canvas 0 22 617 557 Image 0; #X text 80 45 Click here first to disable other examples; #X msg 44 45 0; #X obj 44 78 s off; #X text 59 121 Click here to load an image. Same caching applies as with Quartz mode images (read "Images" from Quartz examples).; #X msg 57 160 model bg image http://pinktwins.com/fantastick/pp_teaser.jpg ; #X text 63 184 NOTE: image dimensions must be power of two!; #X obj 57 210 s toFantastick; #X msg 94 240 accelerometer 0.025; #X msg 94 268 accelerometer 0; #X text 227 240 Turn on accelerometer and move the device...; #X text 228 268 Remember to turn it off before going to the next example. ; #X obj 84 317 r rawFantastick; #X obj 84 341 route A; #X obj 84 366 unpack f f f; #X obj 84 391 * 90; #X msg 84 443 model bg rotate \$1 0 1 0; #X obj 84 416 mavg 10; #X connect 1 0 2 0; #X connect 4 0 6 0; #X connect 7 0 6 0; #X connect 8 0 6 0; #X connect 11 0 12 0; #X connect 12 0 13 0; #X connect 13 0 14 0; #X connect 14 0 16 0; #X connect 15 0 6 0; #X connect 16 0 15 0; #X restore 317 123 pd Image; #N canvas 0 22 611 510 Multitouch 0; #X text 77 41 Click here first to disable other examples; #X msg 41 41 0; #X obj 41 74 s off; #X text 82 122 Click to create five models \, named 1 2 3 4 and 5; #X obj 42 170 until; #X msg 42 122 5; #X obj 42 198 counter; #X obj 42 223 + 1; #X obj 69 275 sprintf http://pinktwins.com/fantastick/%d.jpg; #X obj 42 408 s toFantastick; #X obj 393 267 tgl 15 0 empty empty empty 17 7 0 10 -262144 -1 -1 0 1; #X obj 393 243 r off; #X obj 393 321 gate; #X text 414 266 Enable touch; #X obj 414 295 r rawFantastick; #X obj 393 351 route B M; #X msg 392 391 model \$3 position \$1 \$2; #X text 274 419 Use finger ID to reference the model by name.; #X msg 42 351 model \$1 image \$2; #X obj 69 299 symbol; #X obj 42 251 t f f; #X obj 42 326 pack f s; #X obj 42 145 t f b; #X connect 1 0 2 0; #X connect 4 0 6 0; #X connect 5 0 22 0; #X connect 6 0 7 0; #X connect 7 0 20 0; #X connect 8 0 19 0; #X connect 10 0 12 0; #X connect 11 0 10 0; #X connect 12 0 15 0; #X connect 14 0 12 1; #X connect 15 0 16 0; #X connect 15 1 16 0; #X connect 16 0 9 0; #X connect 18 0 9 0; #X connect 19 0 21 1; #X connect 20 0 21 0; #X connect 20 1 8 0; #X connect 21 0 18 0; #X connect 22 0 4 0; #X connect 22 1 6 2; #X restore 317 147 pd Multitouch; #N canvas 0 22 849 783 Sliders 0; #X text 56 24 Click here first to disable other examples; #X msg 20 24 0; #X obj 20 55 s off; #X obj 363 72 until; #X obj 363 100 counter; #X obj 363 125 + 1; #X obj 363 187 s toFantastick; #X obj 66 360 tgl 15 0 empty empty empty 17 7 0 10 -262144 -1 -1 0 1; #X obj 66 336 r off; #X obj 66 414 gate; #X text 87 359 Enable touch; #X text 403 24 Click to create 4 sliders; #X msg 363 24 4; #X msg 363 154 model \$1 xyz -320 0 0 0 0 0 \, model \$1 width 80; #X text 455 101 Create sliders that are 320 pixels LEFT from their position (X goes from -320 to 0). Setting the X position to touch point brings it to the visible screen area.; #X text 409 215 Click to create cursors for 2 XY-pads and some border ; #X obj 363 217 bng 15 250 50 0 empty empty empty 17 7 0 10 -262144 -1 -1; #X msg 363 246 model pad1 xyz 0 -20 0 20 0 0 0 20 0 -20 0 0 \, model pad1 render line_loop \, model pad1 color 1 0.8 0.8 1; #X msg 363 289 model pad2 xyz 0 -20 0 20 0 0 0 20 0 -20 0 0 \, model pad2 render triangle_fan \, model pad2 color 1 0.8 0.8 1; #X msg 363 343 model borders xyz 160 480 0 160 320 0 0 480 0 320 480 0; #X obj 363 386 s toFantastick; #X obj 87 388 r Fantastick; #X obj 93 574 unpack f f; #X obj 93 654 pack f f f; #X obj 150 599 expr $i1 / 80 + 1; #X obj 150 625 expr $i1 * 80 - 40; #X msg 93 681 model \$3 position \$1 \$2; #X obj 93 706 s toFantastick; #X text 95 730 Update slider positions; #X obj 93 546 gate; #X obj 93 521 < 300; #X obj 66 473 t l l; #X floatatom 286 616 5 0 0 0 - - -; #X floatatom 286 635 5 0 0 0 - - -; #X text 290 657 Which slider is being controlled \, and value for that slider; #X obj 460 503 gate; #X obj 433 430 t l l; #X obj 460 478 > 300; #X obj 564 502 gate; #X obj 537 429 t l l; #X obj 564 477 < 160; #X obj 669 502 gate; #X obj 642 429 t l l; #X obj 669 477 > 160; #X msg 564 530 model pad1 position \$1 \$2; #X obj 626 624 s toFantastick; #X msg 669 552 model pad2 position \$1 \$2; #X floatatom 564 717 5 0 0 0 - - -; #X floatatom 621 717 5 0 0 0 - - -; #X obj 564 694 unpack f f; #X floatatom 669 717 5 0 0 0 - - -; #X floatatom 726 717 5 0 0 0 - - -; #X obj 669 694 unpack f f; #X text 503 743 pad1 and pad2 values (unscaled screen coordinates) ; #X obj 93 497 unpack f f; #X obj 460 454 unpack f f; #X obj 564 453 unpack f f; #X obj 669 453 unpack f f; #X obj 363 47 t f b; #X connect 1 0 2 0; #X connect 3 0 4 0; #X connect 4 0 5 0; #X connect 5 0 13 0; #X connect 7 0 9 0; #X connect 8 0 7 0; #X connect 9 0 31 0; #X connect 9 0 36 0; #X connect 12 0 58 0; #X connect 13 0 6 0; #X connect 16 0 17 0; #X connect 16 0 18 0; #X connect 16 0 19 0; #X connect 17 0 20 0; #X connect 18 0 20 0; #X connect 19 0 20 0; #X connect 21 0 9 1; #X connect 22 0 23 0; #X connect 22 0 33 0; #X connect 22 1 24 0; #X connect 23 0 26 0; #X connect 24 0 23 2; #X connect 24 0 25 0; #X connect 24 0 32 0; #X connect 25 0 23 1; #X connect 26 0 27 0; #X connect 29 0 22 0; #X connect 30 0 29 0; #X connect 31 0 29 1; #X connect 31 1 54 0; #X connect 35 0 39 0; #X connect 35 0 42 0; #X connect 36 0 35 1; #X connect 36 1 55 0; #X connect 37 0 35 0; #X connect 38 0 44 0; #X connect 38 0 49 0; #X connect 39 0 38 1; #X connect 39 1 56 0; #X connect 40 0 38 0; #X connect 41 0 46 0; #X connect 41 0 52 0; #X connect 42 0 41 1; #X connect 42 1 57 0; #X connect 43 0 41 0; #X connect 44 0 45 0; #X connect 46 0 45 0; #X connect 49 0 47 0; #X connect 49 1 48 0; #X connect 52 0 50 0; #X connect 52 1 51 0; #X connect 54 1 30 0; #X connect 55 1 37 0; #X connect 56 0 40 0; #X connect 57 0 43 0; #X connect 58 0 3 0; #X connect 58 1 4 2; #X restore 317 172 pd Sliders and pads; #N canvas 0 22 666 668 Text 0; #X text 77 41 Click here first to disable other examples; #X msg 41 41 0; #X obj 41 74 s off; #X obj 61 346 tgl 15 0 empty empty empty 17 7 0 10 -262144 -1 -1 0 1; #X obj 61 322 r off; #X obj 61 400 gate; #X text 82 345 Enable touch; #X obj 82 374 r rawFantastick; #X obj 61 430 route B M; #X text 137 94 Click to draw text...; #X msg 152 121 model t text check out http://pinktwins.com \, model t position 16 100 0 \, model t font Courier-Bold \, model t fontsize 16; #X msg 152 172 model t rotate 90 0 0 1; #X msg 151 197 model t color 1 1 0 0.9; #X msg 151 224 model t2 text And our other app Pulse+ \, model t2 position 20 300 0; #X obj 230 588 s toFantastick; #X msg 61 457 \$3 \$1 \$2; #X obj 61 483 route 1; #X msg 62 520 model t position \$1 \$2; #X text 251 452 Use one finger to move text around \, and two fingers for...; #N canvas 0 22 556 606 Rotating 0; #X obj 72 65 inlet; #X obj 72 101 route 1 2; #X text 200 101 Separate fingers 1 and 2; #X text 222 160 Get distance between the two points; #X text 222 277 Get angle between the two points; #X obj 97 205 -; #X obj 154 206 -; #X obj 97 276 cartopol; #X obj 142 319 / 3.14159; #X obj 142 344 * 180; #X floatatom 142 373 5 0 0 0 - - -; #X msg 142 402 model t rotate \$1 0 0 1; #X obj 142 433 outlet; #X obj 72 143 unpack f f; #X obj 97 170 unpack f f; #X obj 97 244 pack f f; #X connect 0 0 1 0; #X connect 1 0 13 0; #X connect 1 1 14 0; #X connect 5 0 15 0; #X connect 6 0 15 1; #X connect 7 1 8 0; #X connect 8 0 9 0; #X connect 9 0 10 0; #X connect 10 0 11 0; #X connect 11 0 12 0; #X connect 13 0 5 1; #X connect 13 1 6 1; #X connect 14 0 5 0; #X connect 14 1 6 0; #X connect 15 0 7 0; #X restore 232 475 pd Rotating text; #X obj 107 270 s toFantastick; #X connect 1 0 2 0; #X connect 3 0 5 0; #X connect 4 0 3 0; #X connect 5 0 8 0; #X connect 7 0 5 1; #X connect 8 0 15 0; #X connect 8 1 15 0; #X connect 10 0 20 0; #X connect 11 0 20 0; #X connect 12 0 20 0; #X connect 13 0 20 0; #X connect 15 0 16 0; #X connect 15 0 19 0; #X connect 16 0 17 0; #X connect 17 0 14 0; #X connect 19 0 14 0; #X restore 317 199 pd Text; #N canvas 0 22 792 654 Alpha 0; #X text 77 41 Click here first to disable other examples; #X msg 41 41 0; #X obj 41 74 s off; #X obj 65 365 tgl 15 0 empty empty empty 17 7 0 10 -262144 -1 -1 0 1; #X obj 65 341 r off; #X obj 65 419 gate; #X text 86 364 Enable touch; #X obj 86 393 r rawFantastick; #X obj 65 449 route B M; #X msg 64 489 \$3 \$1 \$2; #X obj 64 516 route 1; #X msg 62 134 model a xyz -80 -80 0 80 -80 0 80 80 0 -80 80 0 \, model a render triangle_fan \, model a color 1 0 0 0.5; #X msg 100 172 model b xyz -80 -80 0 80 -80 0 80 80 0 -80 80 0 \, model b render triangle_fan \, model b color 0 0 1 1; #X msg 128 212 model a position 120 240 10 \, model b position 160 240 -50; #X text 423 134 Click these three boxes. Red is transparent \, blue is not. (alpha for red is 0.5 \, for blue 1); #X text 284 260 Transparency with pngs work...; #X msg 281 281 model c image http://pinktwins.com/fantastick/F3.png ; #X msg 281 362 model c color 1 1 1 1; #X msg 281 385 model c color 1 1 1 0.99999; #X text 285 313 .. but setting the alpha to 1 means the model is opaque and is drawn before transparent objects. See the difference with these two messages.; #X text 287 414 Default alpha for images and text is 0.999999 to draw them with transparency.; #X msg 282 509 model b position 120 240 10 \, model a position 160 240 -50; #X text 287 459 Click here to swap the blue and red boxes around \, and see how the image model behaves with or without transparency. (set alpha to 1 and 0.99999 again to test it); #X text 288 545 To sum it up: when concerned about transparency \, keep alpha below 1 to draw models transparently.; #X msg 70 557 model c position \$1 \$2; #X obj 73 592 s toFantastick; #X obj 128 267 s toFantastick; #X connect 1 0 2 0; #X connect 3 0 5 0; #X connect 4 0 3 0; #X connect 5 0 8 0; #X connect 7 0 5 1; #X connect 8 0 9 0; #X connect 8 1 9 0; #X connect 9 0 10 0; #X connect 10 0 24 0; #X connect 11 0 26 0; #X connect 12 0 26 0; #X connect 13 0 26 0; #X connect 16 0 26 0; #X connect 17 0 26 0; #X connect 18 0 26 0; #X connect 21 0 26 0; #X connect 24 0 25 0; #X restore 317 226 pd Alpha; #X connect 1 0 3 0; #X connect 3 0 4 0; #X connect 5 0 6 0; #X connect 6 0 7 0; #X connect 7 0 8 0; #X restore 301 250 pd Examples; #X restore 29 431 pd OpenGL; #X text 28 481 Accelerometer data; #N canvas 0 22 579 506 Accelerometer 0; #X text 102 66 Enable accelerometer with message "accelerometer ". The interval is in seconds \, and minimum value is 0.01 \, or 10 milliseconds. Use interval of zero to disable accelerometer. ; #X obj 137 236 s toFantastick; #X msg 137 192 accelerometer 1; #X floatatom 300 196 5 0 0 0 - - -; #X msg 300 219 accelerometer \$1; #X obj 137 285 r Accel; #X obj 137 316 prepend set; #X msg 137 356 0.145349 -0.454215 -0.962936; #X text 147 386 x y and z acceleration data raw from the hardware; #X connect 2 0 1 0; #X connect 3 0 4 0; #X connect 4 0 1 0; #X connect 5 0 6 0; #X connect 6 0 7 0; #X restore 28 501 pd Accelerometer; #X connect 5 0 4 0;