diff options
author | Hans-Christoph Steiner <eighthave@users.sourceforge.net> | 2005-12-16 01:05:40 +0000 |
---|---|---|
committer | Hans-Christoph Steiner <eighthave@users.sourceforge.net> | 2005-12-16 01:05:40 +0000 |
commit | b694c274836ac8b04d644711ac324eac2e9ab83e (patch) | |
tree | 36b6a5c17f7e1f414f80697210c2ed3e8005035b /opengl/abstractions | |
parent | e28a07fba67af0af818dda6afa4cf67c09700816 (diff) |
checking in pdp 0.12.4 from http://zwizwa.fartit.com/pd/pdp/pdp-0.12.4.tar.gz
svn path=/trunk/externals/pdp/; revision=4232
Diffstat (limited to 'opengl/abstractions')
-rw-r--r-- | opengl/abstractions/3dp_basicscene.pd | 27 | ||||
-rw-r--r-- | opengl/abstractions/3dp_blend.pd | 13 | ||||
-rw-r--r-- | opengl/abstractions/3dp_display_texture.pd | 31 | ||||
-rw-r--r-- | opengl/abstractions/3dp_fixedsizewindowcontext.pd | 31 | ||||
-rw-r--r-- | opengl/abstractions/3dp_mouserotate.pd | 37 | ||||
-rw-r--r-- | opengl/abstractions/3dp_screenshot.pd | 21 | ||||
-rw-r--r-- | opengl/abstractions/elbat.pd | 41 | ||||
-rw-r--r-- | opengl/abstractions/randomnormal.pd | 39 | ||||
-rw-r--r-- | opengl/abstractions/randomwalk2D.pd | 51 | ||||
-rw-r--r-- | opengl/abstractions/smoothupdate.pd | 49 |
10 files changed, 340 insertions, 0 deletions
diff --git a/opengl/abstractions/3dp_basicscene.pd b/opengl/abstractions/3dp_basicscene.pd new file mode 100644 index 0000000..af79d51 --- /dev/null +++ b/opengl/abstractions/3dp_basicscene.pd @@ -0,0 +1,27 @@ +#N canvas 500 522 450 300 10; +#X obj 54 72 metro 40; +#X obj 54 140 3dp_push; +#X floatatom 375 162 5 0 0 0 - - -; +#X text 19 12 a basic 3d scene with a light source and mouse view rotation +; +#X obj 54 218 outlet; +#X obj 54 46 inlet; +#X floatatom 340 129 5 0 0 0 - - -; +#X floatatom 115 49 5 0 0 0 - - -; +#X obj 254 216 3dp_light 0; +#X obj 254 158 3dp_view roty; +#X obj 254 192 3dp_view transz 10; +#X obj 54 169 3dp_mouserotate; +#X obj 54 111 3dp_windowcontext; +#X connect 0 0 12 0; +#X connect 1 0 11 0; +#X connect 1 1 9 0; +#X connect 2 0 10 1; +#X connect 5 0 0 0; +#X connect 6 0 9 1; +#X connect 7 0 0 1; +#X connect 9 0 10 0; +#X connect 10 0 8 0; +#X connect 11 0 4 0; +#X connect 12 0 1 0; +#X connect 12 1 11 1; diff --git a/opengl/abstractions/3dp_blend.pd b/opengl/abstractions/3dp_blend.pd new file mode 100644 index 0000000..e7768d7 --- /dev/null +++ b/opengl/abstractions/3dp_blend.pd @@ -0,0 +1,13 @@ +#N canvas 554 145 570 225 10; +#X obj 25 124 3dp_toggle depth_test 0; +#X obj 181 159 3dp_toggle blend_add 1; +#X obj 25 90 inlet; +#X obj 330 199 outlet; +#X text 38 11 use this object for quick and dirty blending effects. +it has the depth test disabled and accumulated blending enabled.; +#X text 128 60 NOTE: proper transparency is quite hard to do \, because +it requires manual depth sorting. there is no real support for this +in 3dp yet.; +#X connect 0 1 1 0; +#X connect 1 1 3 0; +#X connect 2 0 0 0; diff --git a/opengl/abstractions/3dp_display_texture.pd b/opengl/abstractions/3dp_display_texture.pd new file mode 100644 index 0000000..63e602b --- /dev/null +++ b/opengl/abstractions/3dp_display_texture.pd @@ -0,0 +1,31 @@ +#N canvas 277 275 874 339 10; +#X obj 244 246 3dp_view scale_aspect; +#X obj 37 131 inlet; +#X obj 222 130 inlet; +#X obj 351 131 inlet; +#X text 27 107 context inlet; +#X text 198 106 texture inlet; +#X text 328 106 scaling inlet; +#X text 406 244 <- scale the square to the window aspect ratio; +#X obj 37 269 outlet; +#X text 40 16 this abstraction can be used for texture display. i.e. +if you use a subcontext at a fixed resolution to create a texture \, +this abstraction stretches the texture to the full size of the window +.; +#X obj 244 274 3dp_draw square 8; +#X obj 244 220 3dp_view scale 1; +#X text 405 219 <- extra scaling (i.e. to clip off garbage boundaries) +; +#X obj 37 162 3dp_toggle depth_test 0; +#X text 404 164 <- disable depth test so the draw will overwrite; +#X obj 193 190 3dp_push; +#X text 405 193 <- save modelview; +#X text 27 295 context outlet; +#X connect 0 0 10 0; +#X connect 1 0 13 0; +#X connect 2 0 10 1; +#X connect 3 0 11 1; +#X connect 11 0 0 0; +#X connect 13 0 8 0; +#X connect 13 1 15 0; +#X connect 15 1 11 0; diff --git a/opengl/abstractions/3dp_fixedsizewindowcontext.pd b/opengl/abstractions/3dp_fixedsizewindowcontext.pd new file mode 100644 index 0000000..5dd5180 --- /dev/null +++ b/opengl/abstractions/3dp_fixedsizewindowcontext.pd @@ -0,0 +1,31 @@ +#N canvas 634 346 592 397 10; +#X obj 27 64 inlet; +#X obj 27 105 3dp_windowcontext; +#X obj 27 138 3dp_subcontext \$1 \$2; +#X obj 220 211 outlet; +#X obj 370 211 outlet; +#X text 350 236 event outlet; +#X obj 162 267 3dp_snap; +#X obj 27 318 3dp_display_texture; +#X text 150 23 a fixed size (window size independent) rendering context +that can be used as 3dp_windowcontext replacement.; +#X text 151 56 creation arguments are the context dimensions.; +#X text 175 87 NOTE: the general subcontext rule applies: if the actual +window size is small than the subcontext \, or is covered by other +windows \, the results might not be what you expect.; +#X text 176 236 context outlet (1); +#X text 241 266 <- when the render chain connected to (1) is done; +#X text 261 281 it will be snapped to texture; +#X text 241 316 <- this texture will then be drawn to cover; +#X text 263 332 the entire window size; +#X obj 162 177 pdp_t p p; +#X obj 184 300 inlet; +#X connect 0 0 1 0; +#X connect 1 0 2 0; +#X connect 1 1 4 0; +#X connect 2 0 7 0; +#X connect 2 1 16 0; +#X connect 6 1 7 1; +#X connect 16 0 6 0; +#X connect 16 1 3 0; +#X connect 17 0 7 2; diff --git a/opengl/abstractions/3dp_mouserotate.pd b/opengl/abstractions/3dp_mouserotate.pd new file mode 100644 index 0000000..b81e27e --- /dev/null +++ b/opengl/abstractions/3dp_mouserotate.pd @@ -0,0 +1,37 @@ +#N canvas 534 483 533 399 10; +#X obj 27 19 inlet; +#X obj 27 363 outlet; +#X obj 70 152 - 0.5; +#X obj 135 151 - 0.5; +#X obj 82 214 *; +#X obj 135 212 *; +#X obj 135 186 t f f; +#X obj 82 184 t f f; +#X obj 82 243 +; +#X obj 113 271 sqrt; +#X obj 92 19 inlet; +#X obj 113 298 * 360; +#X obj 27 329 3dp_view rota; +#X text 216 138 convert mouse coordinates to axis and angle; +#X obj 70 118 unpack 0 0; +#X obj 92 49 route drag1 press1; +#X connect 0 0 12 0; +#X connect 2 0 7 0; +#X connect 2 0 12 2; +#X connect 3 0 6 0; +#X connect 3 0 12 1; +#X connect 4 0 8 0; +#X connect 5 0 8 1; +#X connect 6 0 5 0; +#X connect 6 1 5 1; +#X connect 7 0 4 0; +#X connect 7 1 4 1; +#X connect 8 0 9 0; +#X connect 9 0 11 0; +#X connect 10 0 15 0; +#X connect 11 0 12 4; +#X connect 12 0 1 0; +#X connect 14 0 2 0; +#X connect 14 1 3 0; +#X connect 15 0 14 0; +#X connect 15 1 14 0; diff --git a/opengl/abstractions/3dp_screenshot.pd b/opengl/abstractions/3dp_screenshot.pd new file mode 100644 index 0000000..9cbe07f --- /dev/null +++ b/opengl/abstractions/3dp_screenshot.pd @@ -0,0 +1,21 @@ +#N canvas 550 41 714 494 10; +#X obj 193 284 pdp_reg; +#X obj 193 203 pdp_t b p; +#X obj 193 233 symbol \$1; +#X msg 193 257 save_png \$1; +#X obj 195 110 loadbang; +#X msg 195 135 autosnap 0; +#X obj 51 111 inlet; +#X obj 51 176 3dp_snap bitmap/rgb/*; +#X obj 51 285 outlet; +#X text 41 22 make a screenshot of a 3dp context. creation argument +is filename. send a bang to take a snapshot.; +#X connect 1 0 2 0; +#X connect 1 1 0 1; +#X connect 2 0 3 0; +#X connect 3 0 0 0; +#X connect 4 0 5 0; +#X connect 5 0 7 0; +#X connect 6 0 7 0; +#X connect 7 0 8 0; +#X connect 7 1 1 0; diff --git a/opengl/abstractions/elbat.pd b/opengl/abstractions/elbat.pd new file mode 100644 index 0000000..211da15 --- /dev/null +++ b/opengl/abstractions/elbat.pd @@ -0,0 +1,41 @@ +#N canvas 431 78 581 572 10; +#X obj 23 63 inlet; +#X obj 168 211 outlet; +#X obj 168 150 tabread \$0-vec; +#X msg 15 210 \; \$1 const 0; +#X msg 15 159 bang; +#X obj 15 183 symbol \$0-vec; +#X obj 119 373 until; +#X msg 118 270 bang; +#X obj 155 414 f 0; +#X obj 191 414 + 1; +#X msg 163 338 0; +#X obj 119 318 t b b; +#X obj 156 519 tabwrite \$0-vec; +#X obj 155 443 t b f; +#X obj 154 478 randomnormal; +#X obj 119 348 f \$1; +#X obj 23 86 route reset normal; +#X text 168 274 fill table with normal distributed random variables +; +#X text 19 16 a tabread-like abstraction (with internal table); +#X obj 320 108 table \$0-vec \$1; +#X connect 0 0 16 0; +#X connect 2 0 1 0; +#X connect 4 0 5 0; +#X connect 5 0 3 0; +#X connect 6 0 8 0; +#X connect 7 0 11 0; +#X connect 8 0 9 0; +#X connect 8 0 13 0; +#X connect 9 0 8 1; +#X connect 10 0 8 1; +#X connect 11 0 15 0; +#X connect 11 1 10 0; +#X connect 13 0 14 0; +#X connect 13 1 12 1; +#X connect 14 0 12 0; +#X connect 15 0 6 0; +#X connect 16 0 4 0; +#X connect 16 1 7 0; +#X connect 16 2 2 0; diff --git a/opengl/abstractions/randomnormal.pd b/opengl/abstractions/randomnormal.pd new file mode 100644 index 0000000..bf1d4fa --- /dev/null +++ b/opengl/abstractions/randomnormal.pd @@ -0,0 +1,39 @@ +#N canvas 614 389 451 505 10; +#X obj 48 58 inlet; +#X obj 48 88 t b b; +#X obj 173 167 * 6.28; +#X obj 129 221 cos; +#X obj 173 222 sin; +#X obj 173 143 / 1e+06; +#X obj 173 121 random 1e+06; +#X obj 48 220 * -2; +#X obj 48 170 / 1e+06; +#X obj 48 125 random 1e+06; +#X obj 48 148 + 1; +#X obj 48 194 log; +#X obj 48 327 *; +#X obj 108 328 *; +#X obj 48 292 t f f; +#X obj 48 365 outlet; +#X obj 108 365 outlet; +#X text 35 10 normal gausian random number generator (box-muller); +#X obj 48 253 sqrt; +#X connect 0 0 1 0; +#X connect 1 0 9 0; +#X connect 1 1 6 0; +#X connect 2 0 4 0; +#X connect 2 0 3 0; +#X connect 3 0 12 1; +#X connect 4 0 13 1; +#X connect 5 0 2 0; +#X connect 6 0 5 0; +#X connect 7 0 18 0; +#X connect 8 0 11 0; +#X connect 9 0 10 0; +#X connect 10 0 8 0; +#X connect 11 0 7 0; +#X connect 12 0 15 0; +#X connect 13 0 16 0; +#X connect 14 0 12 0; +#X connect 14 1 13 0; +#X connect 18 0 14 0; diff --git a/opengl/abstractions/randomwalk2D.pd b/opengl/abstractions/randomwalk2D.pd new file mode 100644 index 0000000..58cf2df --- /dev/null +++ b/opengl/abstractions/randomwalk2D.pd @@ -0,0 +1,51 @@ +#N canvas 502 172 600 400 10; +#X obj 228 221 tabread \$0-x; +#X obj 334 213 tabread \$0-y; +#X obj 228 310 tabwrite \$0-x; +#X obj 350 330 tabwrite \$0-y; +#X obj 244 259 cos; +#X obj 350 266 sin; +#X obj 351 241 * 0.0628; +#X obj 351 185 random 100; +#X obj 228 284 +; +#X obj 334 291 +; +#X obj 228 144 t f b f; +#X msg 53 237 \; \$1 const 0; +#X obj 20 199 symbol \$0-x; +#X obj 108 199 symbol \$0-y; +#X msg 88 173 bang; +#X obj 228 172 t f f; +#X obj 214 337 outlet; +#X obj 334 354 outlet; +#X obj 156 82 inlet; +#X obj 156 106 route reset; +#X obj 351 82 table \$0-x \$1; +#X obj 351 116 table \$0-y \$1; +#X text 37 20 a 2D unit step random walk abstraction for use with 3dp_for +; +#X text 335 45 creation argument = nb of vectors; +#X text 64 44 inlet = vector to update; +#X connect 0 0 8 0; +#X connect 1 0 9 0; +#X connect 4 0 8 1; +#X connect 5 0 9 1; +#X connect 6 0 4 0; +#X connect 6 0 5 0; +#X connect 7 0 6 0; +#X connect 8 0 2 0; +#X connect 8 0 16 0; +#X connect 9 0 3 0; +#X connect 9 0 17 0; +#X connect 10 0 15 0; +#X connect 10 1 7 0; +#X connect 10 2 3 1; +#X connect 10 2 2 1; +#X connect 12 0 11 0; +#X connect 13 0 11 0; +#X connect 14 0 12 0; +#X connect 14 0 13 0; +#X connect 15 0 0 0; +#X connect 15 1 1 0; +#X connect 18 0 19 0; +#X connect 19 0 14 0; +#X connect 19 1 10 0; diff --git a/opengl/abstractions/smoothupdate.pd b/opengl/abstractions/smoothupdate.pd new file mode 100644 index 0000000..19df278 --- /dev/null +++ b/opengl/abstractions/smoothupdate.pd @@ -0,0 +1,49 @@ +#N canvas 112 570 450 387 10; +#X obj 225 64 inlet; +#X text 195 40 element to update; +#X obj 23 63 inlet; +#X text 39 39 new value; +#X obj 55 302 outlet; +#X obj 331 173 table \$0-vec; +#X obj 168 121 f 0; +#X obj 168 150 tabread \$0-vec; +#X text 350 41 smooth step; +#X obj 354 65 inlet; +#X obj 354 90 moses 0; +#X obj 366 116 moses 1; +#X msg 331 114 0; +#X msg 410 140 1; +#X obj 135 182 -; +#X obj 57 114 t f b; +#X obj 332 144 f; +#X obj 135 246 +; +#X obj 146 282 tabwrite \$0-vec; +#X obj 23 86 route reset; +#X msg 15 210 \; \$1 const 0; +#X msg 15 159 bang; +#X obj 15 183 symbol \$0-vec; +#X obj 136 215 * 0.1; +#X connect 0 0 6 1; +#X connect 2 0 19 0; +#X connect 6 0 7 0; +#X connect 6 0 18 1; +#X connect 7 0 14 1; +#X connect 7 0 17 1; +#X connect 9 0 10 0; +#X connect 10 0 12 0; +#X connect 10 1 11 0; +#X connect 11 0 16 0; +#X connect 11 1 13 0; +#X connect 12 0 16 0; +#X connect 13 0 16 0; +#X connect 14 0 23 0; +#X connect 15 0 14 0; +#X connect 15 1 6 0; +#X connect 16 0 23 1; +#X connect 17 0 4 0; +#X connect 17 0 18 0; +#X connect 19 0 21 0; +#X connect 19 1 15 0; +#X connect 21 0 22 0; +#X connect 22 0 20 0; +#X connect 23 0 17 0; |