aboutsummaryrefslogtreecommitdiff
path: root/Gem/examples/03.lighting
diff options
context:
space:
mode:
Diffstat (limited to 'Gem/examples/03.lighting')
-rw-r--r--Gem/examples/03.lighting/01.world_light.pd84
-rw-r--r--Gem/examples/03.lighting/02.light.pd96
-rw-r--r--Gem/examples/03.lighting/03.controlLights.pd97
-rw-r--r--Gem/examples/03.lighting/04.moveSpheres.pd128
-rw-r--r--Gem/examples/03.lighting/05.materials.pd86
5 files changed, 491 insertions, 0 deletions
diff --git a/Gem/examples/03.lighting/01.world_light.pd b/Gem/examples/03.lighting/01.world_light.pd
new file mode 100644
index 0000000..8987c38
--- /dev/null
+++ b/Gem/examples/03.lighting/01.world_light.pd
@@ -0,0 +1,84 @@
+#N canvas 139 90 771 570 10;
+#X obj 518 59 gemhead;
+#X msg 86 180 lighting 1;
+#X obj 518 170 rotate;
+#X floatatom 563 132 0 0 0 0 - - -;
+#X obj 318 508 world_light;
+#X obj 318 394 gemhead 1;
+#X msg 86 149 lighting 0;
+#X obj 518 194 sphere;
+#X text 150 38 create a sphere with and without lighting;
+#X text 533 105 rotate the sphere;
+#X text 139 545 creates a light an infinite distance away.;
+#X text 314 341 gemhead has a value of 1 so that it is rendered before
+the sphere is;
+#X text 52 124 you can turn lighting on and off while it is running
+;
+#X msg 457 466 1 1 1;
+#X msg 404 464 1 0 1;
+#X text 508 460 change the lights color;
+#X obj 318 456 rotateXYZ;
+#X floatatom 409 399 0 0 0 0 - - -;
+#X msg 185 424 debug 0;
+#X msg 186 455 debug 1;
+#X text 96 400 figure out where the light is;
+#N canvas 87 154 247 179 Gem.init 0;
+#X obj 118 46 loadbang;
+#X msg 118 81 reset;
+#X obj 118 113 outlet;
+#X connect 0 0 1 0;
+#X connect 1 0 2 0;
+#X restore 64 238 pd Gem.init;
+#N canvas 340 107 682 322 gemwin 0;
+#X obj 102 122 tgl 15 0 \$0-gemstart \$0-gemstart empty 17 7 0 10 -262144
+-1 -1 0 1;
+#X obj 102 161 r \$0-gemstart;
+#X obj 102 182 select 1 0;
+#X msg 102 214 create \, 1;
+#X msg 177 215 destroy;
+#X obj 102 239 t a;
+#X obj 318 54 inlet;
+#X obj 318 255 gemwin;
+#X obj 318 100 t a a;
+#X obj 318 287 outlet;
+#X obj 350 128 route create destroy;
+#X obj 350 150 t b;
+#X msg 350 172 1;
+#X obj 390 150 t b;
+#X msg 390 172 0;
+#X obj 350 195 t f;
+#X msg 350 219 set \$1;
+#X text 118 122 rendering;
+#X connect 1 0 2 0;
+#X connect 2 0 3 0;
+#X connect 2 1 4 0;
+#X connect 3 0 5 0;
+#X connect 4 0 5 0;
+#X connect 5 0 8 0;
+#X connect 6 0 8 0;
+#X connect 7 0 9 0;
+#X connect 8 0 7 0;
+#X connect 8 1 10 0;
+#X connect 10 0 11 0;
+#X connect 10 1 13 0;
+#X connect 11 0 12 0;
+#X connect 12 0 15 0;
+#X connect 13 0 14 0;
+#X connect 14 0 15 0;
+#X connect 15 0 16 0;
+#X connect 16 0 0 0;
+#X coords 0 -1 1 1 85 40 1 100 100;
+#X restore 34 255 pd gemwin;
+#X connect 0 0 2 0;
+#X connect 1 0 22 0;
+#X connect 2 0 7 0;
+#X connect 3 0 2 1;
+#X connect 5 0 16 0;
+#X connect 6 0 22 0;
+#X connect 13 0 4 1;
+#X connect 14 0 4 1;
+#X connect 16 0 4 0;
+#X connect 17 0 16 2;
+#X connect 18 0 4 0;
+#X connect 19 0 4 0;
+#X connect 21 0 22 0;
diff --git a/Gem/examples/03.lighting/02.light.pd b/Gem/examples/03.lighting/02.light.pd
new file mode 100644
index 0000000..21f8811
--- /dev/null
+++ b/Gem/examples/03.lighting/02.light.pd
@@ -0,0 +1,96 @@
+#N canvas 253 63 751 605 10;
+#X obj 532 45 gemhead;
+#X msg 107 177 lighting 1;
+#X obj 532 156 rotate;
+#X floatatom 580 137 4 0 0 0 - - -;
+#X obj 313 354 gemhead 1;
+#X msg 107 146 lighting 0;
+#X obj 532 177 sphere;
+#X text 150 38 create a sphere with and without lighting;
+#X text 547 91 rotate the sphere;
+#X text 313 314 gemhead has a value of 1 so that it is rendered before
+the sphere is;
+#X text 46 125 you can turn lighting on and off while it is running
+;
+#X msg 398 507 1 1 1;
+#X msg 345 505 1 0 1;
+#X text 449 501 change the lights color;
+#X floatatom 389 355 0 0 0 0 - - -;
+#X msg 185 424 debug 0;
+#X msg 186 455 debug 1;
+#X text 96 400 figure out where the light is;
+#X obj 313 535 light;
+#X text 240 558 creates a local light;
+#X msg 434 436 2;
+#X msg 477 436 3;
+#X msg 390 438 1.1;
+#X text 389 417 change the position of the light;
+#X obj 313 395 rotateXYZ 0 -60 0;
+#X obj 313 475 translateXYZ 2 0 0;
+#X obj 566 118 hsl 128 15 0 360 0 0 empty empty empty -2 -6 0 10 -233472
+-1 -1 0 1;
+#N canvas 87 154 247 179 Gem.init 0;
+#X obj 118 46 loadbang;
+#X msg 118 81 reset;
+#X obj 118 113 outlet;
+#X connect 0 0 1 0;
+#X connect 1 0 2 0;
+#X restore 62 264 pd Gem.init;
+#N canvas 340 107 682 322 gemwin 0;
+#X obj 102 122 tgl 15 0 \$0-gemstart \$0-gemstart empty 17 7 0 10 -262144
+-1 -1 0 1;
+#X obj 102 161 r \$0-gemstart;
+#X obj 102 182 select 1 0;
+#X msg 102 214 create \, 1;
+#X msg 177 215 destroy;
+#X obj 102 239 t a;
+#X obj 318 54 inlet;
+#X obj 318 255 gemwin;
+#X obj 318 100 t a a;
+#X obj 318 287 outlet;
+#X obj 350 128 route create destroy;
+#X obj 350 150 t b;
+#X msg 350 172 1;
+#X obj 390 150 t b;
+#X msg 390 172 0;
+#X obj 350 195 t f;
+#X msg 350 219 set \$1;
+#X text 118 122 rendering;
+#X connect 1 0 2 0;
+#X connect 2 0 3 0;
+#X connect 2 1 4 0;
+#X connect 3 0 5 0;
+#X connect 4 0 5 0;
+#X connect 5 0 8 0;
+#X connect 6 0 8 0;
+#X connect 7 0 9 0;
+#X connect 8 0 7 0;
+#X connect 8 1 10 0;
+#X connect 10 0 11 0;
+#X connect 10 1 13 0;
+#X connect 11 0 12 0;
+#X connect 12 0 15 0;
+#X connect 13 0 14 0;
+#X connect 14 0 15 0;
+#X connect 15 0 16 0;
+#X connect 16 0 0 0;
+#X coords 0 -1 1 1 85 40 1 100 100;
+#X restore 32 281 pd gemwin;
+#X connect 0 0 2 0;
+#X connect 1 0 28 0;
+#X connect 2 0 6 0;
+#X connect 4 0 24 0;
+#X connect 5 0 28 0;
+#X connect 11 0 18 1;
+#X connect 12 0 18 1;
+#X connect 14 0 24 2;
+#X connect 15 0 18 0;
+#X connect 16 0 18 0;
+#X connect 20 0 25 1;
+#X connect 21 0 25 1;
+#X connect 22 0 25 1;
+#X connect 24 0 25 0;
+#X connect 25 0 18 0;
+#X connect 26 0 2 1;
+#X connect 26 0 3 0;
+#X connect 27 0 28 0;
diff --git a/Gem/examples/03.lighting/03.controlLights.pd b/Gem/examples/03.lighting/03.controlLights.pd
new file mode 100644
index 0000000..04a3dae
--- /dev/null
+++ b/Gem/examples/03.lighting/03.controlLights.pd
@@ -0,0 +1,97 @@
+#N canvas 396 160 600 500 10;
+#X obj 373 75 gemhead;
+#X msg 128 75 lighting 1;
+#X msg 128 107 lighting 0;
+#X obj 373 115 sphere;
+#X obj 148 268 gemhead;
+#X obj 148 424 light;
+#X obj 148 308 rotateXYZ;
+#X floatatom 238 274 0 0 0 0 - - -;
+#X msg 55 355 debug 1;
+#X msg 56 388 debug 0;
+#X msg 178 399 1 0 0;
+#X obj 148 346 translateXYZ 3 0 0;
+#X obj 399 256 gemhead;
+#X obj 399 296 rotateXYZ;
+#X floatatom 489 262 0 0 0 0 - - -;
+#X msg 305 352 debug 1;
+#X msg 306 385 debug 0;
+#X msg 471 396 0 1 0;
+#X obj 399 426 world_light;
+#X obj 471 364 loadbang;
+#X obj 178 370 loadbang;
+#X floatatom 246 305 0 0 0 0 - - -;
+#X text 263 177 notice that translation affects the;
+#X text 261 190 light object \, but not the world_light;
+#X obj 399 336 translateXYZ 3 0 0;
+#X floatatom 476 312 0 0 0 0 - - -;
+#X text 504 311 quite useless;
+#N canvas 87 154 247 179 Gem.init 0;
+#X obj 118 46 loadbang;
+#X msg 118 81 reset;
+#X obj 118 113 outlet;
+#X connect 0 0 1 0;
+#X connect 1 0 2 0;
+#X restore 64 148 pd Gem.init;
+#N canvas 340 107 682 322 gemwin 0;
+#X obj 102 122 tgl 15 0 \$0-gemstart \$0-gemstart empty 17 7 0 10 -262144
+-1 -1 0 1;
+#X obj 102 161 r \$0-gemstart;
+#X obj 102 182 select 1 0;
+#X msg 102 214 create \, 1;
+#X msg 177 215 destroy;
+#X obj 102 239 t a;
+#X obj 318 54 inlet;
+#X obj 318 255 gemwin;
+#X obj 318 100 t a a;
+#X obj 318 287 outlet;
+#X obj 350 128 route create destroy;
+#X obj 350 150 t b;
+#X msg 350 172 1;
+#X obj 390 150 t b;
+#X msg 390 172 0;
+#X obj 350 195 t f;
+#X msg 350 219 set \$1;
+#X text 118 122 rendering;
+#X connect 1 0 2 0;
+#X connect 2 0 3 0;
+#X connect 2 1 4 0;
+#X connect 3 0 5 0;
+#X connect 4 0 5 0;
+#X connect 5 0 8 0;
+#X connect 6 0 8 0;
+#X connect 7 0 9 0;
+#X connect 8 0 7 0;
+#X connect 8 1 10 0;
+#X connect 10 0 11 0;
+#X connect 10 1 13 0;
+#X connect 11 0 12 0;
+#X connect 12 0 15 0;
+#X connect 13 0 14 0;
+#X connect 14 0 15 0;
+#X connect 15 0 16 0;
+#X connect 16 0 0 0;
+#X coords 0 -1 1 1 85 40 1 100 100;
+#X restore 34 165 pd gemwin;
+#X connect 0 0 3 0;
+#X connect 1 0 28 0;
+#X connect 2 0 28 0;
+#X connect 4 0 6 0;
+#X connect 6 0 11 0;
+#X connect 7 0 6 2;
+#X connect 8 0 5 0;
+#X connect 9 0 5 0;
+#X connect 10 0 5 1;
+#X connect 11 0 5 0;
+#X connect 12 0 13 0;
+#X connect 13 0 24 0;
+#X connect 14 0 13 1;
+#X connect 15 0 18 0;
+#X connect 16 0 18 0;
+#X connect 17 0 18 1;
+#X connect 19 0 17 0;
+#X connect 20 0 10 0;
+#X connect 21 0 11 1;
+#X connect 24 0 18 0;
+#X connect 25 0 24 1;
+#X connect 27 0 28 0;
diff --git a/Gem/examples/03.lighting/04.moveSpheres.pd b/Gem/examples/03.lighting/04.moveSpheres.pd
new file mode 100644
index 0000000..b2df9dd
--- /dev/null
+++ b/Gem/examples/03.lighting/04.moveSpheres.pd
@@ -0,0 +1,128 @@
+#N canvas 172 20 824 640 10;
+#X text 745 116 on;
+#X text 782 114 off;
+#X text 557 122 on;
+#X text 594 120 off;
+#X msg 742 143 1;
+#X msg 779 142 0;
+#X text 303 503 on;
+#X text 340 501 off;
+#X msg 116 527 1;
+#X msg 152 529 0;
+#X msg 297 529 1;
+#X msg 335 529 0;
+#X obj 373 547 gemhead 1;
+#X obj 483 231 int 0;
+#X obj 532 231 + 2;
+#X obj 634 118 gemhead;
+#X floatatom 673 252 0 0 0 0 - - -;
+#X obj 444 115 gemhead;
+#X msg 34 171 dimen 300 300;
+#X msg 64 102 lighting 1;
+#X floatatom 483 264 0 0 0 0 - - -;
+#X obj 194 573 world_light;
+#X obj 194 534 gemhead 1;
+#X msg 63 74 lighting 0;
+#X obj 673 225 int 0;
+#X obj 373 584 light;
+#X text 125 480 global light;
+#X text 303 483 local light;
+#X text 122 505 on;
+#X text 152 506 off;
+#X text 13 133 set the window size to 300 x 300;
+#X text 28 48 you can turn lighting on and off while it is running
+;
+#X obj 483 197 metro 50;
+#X msg 555 145 1;
+#X msg 591 146 0;
+#X obj 673 191 metro 100;
+#X obj 735 223 + 1;
+#X obj 444 147 colorRGB 1 0 1;
+#X obj 634 146 colorRGB 0 1 0;
+#X obj 444 301 rotate 0 1 0;
+#X obj 444 342 translate 2 1 0 0;
+#X obj 634 329 translate 2 0 1 0;
+#X obj 634 287 rotate 1 0 0;
+#X text 446 69 Purple sphere;
+#X text 636 74 Green sphere;
+#N canvas 87 154 247 179 Gem.init 0;
+#X obj 118 46 loadbang;
+#X msg 118 81 reset;
+#X obj 118 113 outlet;
+#X connect 0 0 1 0;
+#X connect 1 0 2 0;
+#X restore 64 238 pd Gem.init;
+#N canvas 340 107 682 322 gemwin 0;
+#X obj 102 122 tgl 15 0 \$0-gemstart \$0-gemstart empty 17 7 0 10 -262144
+-1 -1 0 1;
+#X obj 102 161 r \$0-gemstart;
+#X obj 102 182 select 1 0;
+#X msg 102 214 create \, 1;
+#X msg 177 215 destroy;
+#X obj 102 239 t a;
+#X obj 318 54 inlet;
+#X obj 318 255 gemwin;
+#X obj 318 100 t a a;
+#X obj 318 287 outlet;
+#X obj 350 128 route create destroy;
+#X obj 350 150 t b;
+#X msg 350 172 1;
+#X obj 390 150 t b;
+#X msg 390 172 0;
+#X obj 350 195 t f;
+#X msg 350 219 set \$1;
+#X text 118 122 rendering;
+#X connect 1 0 2 0;
+#X connect 2 0 3 0;
+#X connect 2 1 4 0;
+#X connect 3 0 5 0;
+#X connect 4 0 5 0;
+#X connect 5 0 8 0;
+#X connect 6 0 8 0;
+#X connect 7 0 9 0;
+#X connect 8 0 7 0;
+#X connect 8 1 10 0;
+#X connect 10 0 11 0;
+#X connect 10 1 13 0;
+#X connect 11 0 12 0;
+#X connect 12 0 15 0;
+#X connect 13 0 14 0;
+#X connect 14 0 15 0;
+#X connect 15 0 16 0;
+#X connect 16 0 0 0;
+#X coords 0 -1 1 1 85 40 1 100 100;
+#X restore 34 255 pd gemwin;
+#X obj 444 424 sphere 1 5;
+#X obj 634 416 sphere 1 20;
+#X connect 4 0 35 0;
+#X connect 5 0 35 0;
+#X connect 8 0 21 0;
+#X connect 9 0 21 0;
+#X connect 10 0 25 0;
+#X connect 11 0 25 0;
+#X connect 12 0 25 0;
+#X connect 13 0 14 0;
+#X connect 13 0 20 0;
+#X connect 14 0 13 1;
+#X connect 15 0 38 0;
+#X connect 16 0 42 1;
+#X connect 17 0 37 0;
+#X connect 18 0 46 0;
+#X connect 19 0 46 0;
+#X connect 20 0 39 1;
+#X connect 22 0 21 0;
+#X connect 23 0 46 0;
+#X connect 24 0 16 0;
+#X connect 24 0 36 0;
+#X connect 32 0 13 0;
+#X connect 33 0 32 0;
+#X connect 34 0 32 0;
+#X connect 35 0 24 0;
+#X connect 36 0 24 1;
+#X connect 37 0 39 0;
+#X connect 38 0 42 0;
+#X connect 39 0 40 0;
+#X connect 40 0 47 0;
+#X connect 41 0 48 0;
+#X connect 42 0 41 0;
+#X connect 45 0 46 0;
diff --git a/Gem/examples/03.lighting/05.materials.pd b/Gem/examples/03.lighting/05.materials.pd
new file mode 100644
index 0000000..9d722f5
--- /dev/null
+++ b/Gem/examples/03.lighting/05.materials.pd
@@ -0,0 +1,86 @@
+#N canvas 253 63 743 597 10;
+#X obj 349 34 gemhead;
+#X obj 349 307 rotate;
+#X floatatom 367 272 0 0 0 0 - - -;
+#X obj 220 436 gemhead 1;
+#X text 83 397 gemhead has a value of 1 so that it is rendered before
+the sphere is;
+#X obj 220 539 light;
+#X text 271 543 creates a local light;
+#X obj 220 507 translateXYZ 3 0 0;
+#X text 150 38 apply materials to a sphere;
+#X obj 349 122 diffuse 0.2 0 0;
+#X obj 349 224 ambientRGB 0 0 0;
+#X obj 349 163 specular 0 0 0.9;
+#X obj 349 78 shininess 128;
+#X obj 349 361 sphere 2;
+#X msg 428 322 50;
+#X msg 469 32 10;
+#X msg 506 32 100;
+#X obj 220 477 rotateXYZ 0 -90 0;
+#N canvas 91 174 290 179 Gem.init 0;
+#X obj 118 18 loadbang;
+#X msg 201 78 reset;
+#X obj 118 113 outlet;
+#X obj 118 45 t b b;
+#X msg 118 79 lighting 1;
+#X connect 0 0 3 0;
+#X connect 1 0 2 0;
+#X connect 3 0 4 0;
+#X connect 3 1 1 0;
+#X connect 4 0 2 0;
+#X restore 34 138 pd Gem.init;
+#N canvas 340 107 682 322 gemwin 0;
+#X obj 102 122 tgl 15 0 \$0-gemstart \$0-gemstart empty 17 7 0 10 -262144
+-1 -1 0 1;
+#X obj 102 161 r \$0-gemstart;
+#X obj 102 182 select 1 0;
+#X msg 102 214 create \, 1;
+#X msg 177 215 destroy;
+#X obj 102 239 t a;
+#X obj 318 54 inlet;
+#X obj 318 255 gemwin;
+#X obj 318 100 t a a;
+#X obj 318 287 outlet;
+#X obj 350 128 route create destroy;
+#X obj 350 150 t b;
+#X msg 350 172 1;
+#X obj 390 150 t b;
+#X msg 390 172 0;
+#X obj 350 195 t f;
+#X msg 350 219 set \$1;
+#X text 118 122 rendering;
+#X connect 1 0 2 0;
+#X connect 2 0 3 0;
+#X connect 2 1 4 0;
+#X connect 3 0 5 0;
+#X connect 4 0 5 0;
+#X connect 5 0 8 0;
+#X connect 6 0 8 0;
+#X connect 7 0 9 0;
+#X connect 8 0 7 0;
+#X connect 8 1 10 0;
+#X connect 10 0 11 0;
+#X connect 10 1 13 0;
+#X connect 11 0 12 0;
+#X connect 12 0 15 0;
+#X connect 13 0 14 0;
+#X connect 14 0 15 0;
+#X connect 15 0 16 0;
+#X connect 16 0 0 0;
+#X coords 0 -1 1 1 85 40 1 100 100;
+#X restore 34 155 pd gemwin;
+#X connect 0 0 12 0;
+#X connect 1 0 13 0;
+#X connect 2 0 1 1;
+#X connect 3 0 17 0;
+#X connect 7 0 5 0;
+#X connect 9 0 11 0;
+#X connect 10 0 1 0;
+#X connect 11 0 10 0;
+#X connect 12 0 9 0;
+#X connect 14 0 13 2;
+#X connect 15 0 12 1;
+#X connect 16 0 12 1;
+#X connect 17 0 7 0;
+#X connect 18 0 19 0;