Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Added clipping to output
  • Loading branch information
macumbista committed Aug 14, 2018
1 parent be250ea commit afa7a95
Showing 1 changed file with 20 additions and 12 deletions.
32 changes: 20 additions & 12 deletions VS-projector.pd
@@ -1,9 +1,9 @@
#N canvas -226 23 963 662 10;
#N canvas 271 48 963 662 10;
#X obj 79 50 inlet~ X;
#X obj 149 50 inlet~ Y;
#X obj 227 49 inlet~ Z;
#X obj 295 48 inlet~ brightness;
#X obj 536 429 outlet~ brightness;
#X obj 536 448 outlet~ brightness;
#X text 64 487 A = viewing distance;
#X text 64 507 Sx = viewing angle X;
#X text 64 527 Sy = viewing angle Y;
Expand All @@ -23,32 +23,37 @@
#X text 345 515 ) + Sx;
#X text 460 510 _____;
#X text 505 515 ) + Sy;
#X obj 79 388 outlet~ Xout;
#X obj 235 388 outlet~ Yout;
#X obj 79 448 outlet~ Xout;
#X obj 235 448 outlet~ Yout;
#X text 244 515 Xout = (;
#X text 404 515 Yout = (;
#X text 305 524 Z/A;
#X text 465 524 Z/A;
#X text 303 505 X-Sx;
#X text 463 505 Y-Sy;
#X obj 536 237 expr~ ($v2-$v1)/$v2;
#X obj 536 403 *~;
#X obj 536 393 *~;
#X obj 536 163 expr~ ($v1 + 1)*0.5;
#X obj 551 376 expr~ $v1>0;
#X obj 551 366 expr~ $v1>0;
#X text 712 532 Helsinki August 2018;
#X text 683 161 Convert Z to unipolar;
#X text 602 403 Clip brightness at screen boundary;
#X text 630 366 Clip brightness at screen boundary;
#X text 686 213 i(D) =;
#X text 733 202 Dmax - D;
#X text 730 213 ---------;
#X text 741 226 Dmax;
#X text 705 245 i = intensity;
#X text 705 263 D = distance;
#X obj 536 346 *~;
#X text 575 347 Multiply by brightness scaler;
#X obj 536 336 *~;
#X text 575 337 Multiply by brightness scaler;
#X text 681 306 Dunn & Parberry \, 2002;
#X text 582 288 SOURCE: "3D Math Primer for Graphics and Game Development"
\,;
#X obj 79 379 clip~ -1 1;
#X obj 235 379 clip~ -1 1;
#X obj 536 420 clip~ 0 1;
#X text 106 408 Extreme settings create high amplitude signals. Clipping
for safety here recommended!;
#X connect 0 0 13 0;
#X connect 1 0 10 0;
#X connect 2 0 8 0;
Expand All @@ -58,14 +63,17 @@
#X connect 8 0 13 1;
#X connect 9 0 10 2;
#X connect 9 0 13 2;
#X connect 10 0 24 0;
#X connect 10 0 49 0;
#X connect 11 0 13 3;
#X connect 12 0 10 3;
#X connect 13 0 23 0;
#X connect 13 0 48 0;
#X connect 14 0 31 1;
#X connect 31 0 44 0;
#X connect 32 0 4 0;
#X connect 32 0 50 0;
#X connect 33 0 31 0;
#X connect 33 0 34 0;
#X connect 34 0 32 1;
#X connect 44 0 32 0;
#X connect 48 0 23 0;
#X connect 49 0 24 0;
#X connect 50 0 4 0;

0 comments on commit afa7a95

Please sign in to comment.