04_ev_example_3d.pd 4.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154
  1. #N canvas 160 22 912 712 10;
  2. #X declare -path . -path .. -path data -path ../data -path ev-in -path
  3. ../ev-in -path ev-main -path ../ev-main -path ev-pano -path ../ev-pano
  4. -path ev-pro -path ../ev-pro -path libs/gil -path ../libs/gil -path
  5. libs/kollabs -path ../libs/kollabs -path media -path ../media -path
  6. ev-glsl -path ../ev-glsl -lib Gem;
  7. #X obj 106 655 world_light;
  8. #X obj 106 631 gemhead;
  9. #X obj 14 14 cnv 15 700 30 empty empty Example:_3d_renderings 20 12
  10. 0 14 -233017 -66577 0;
  11. #X obj 707 315 s /ev/buf/0/color;
  12. #X msg 707 290 0.9 0.6 0.1 1;
  13. #X obj 707 245 loadbang;
  14. #X obj 707 267 del 3000;
  15. #X obj 43 114 gemhead 20;
  16. #X obj 33 455 cnv 15 250 135 empty empty 3d_rendering 20 12 0 10 -233017
  17. -66577 0;
  18. #X obj 43 530 teapot;
  19. #N canvas 0 22 482 487 teapot-movement 0;
  20. #X obj 81 -49 inlet;
  21. #X obj 81 263 outlet;
  22. #X obj 81 149 translateXYZ 0 0 0;
  23. #X obj 81 189 rotateXYZ 0 0 0;
  24. #X obj 177 -12 bng 15 250 50 0 empty empty empty 17 7 0 10 -262144
  25. -1 -1;
  26. #X obj 198 -12 metro 10000;
  27. #X obj 81 211 scaleXYZ 0.6 0.6 0.6;
  28. #X msg 198 20 0 \, 1 10000;
  29. #X obj 198 149 * 360;
  30. #X obj 198 -49 loadbang;
  31. #X obj 109 -10 bng 15 250 50 0 empty empty empty 17 7 0 10 -262144
  32. -1 -1;
  33. #X msg 131 -12 1;
  34. #X obj 116 85 *;
  35. #X obj 116 107 cos;
  36. #X obj 116 129 * 4;
  37. #X obj 131 20 atan;
  38. #X obj 131 50 * 8;
  39. #X obj 81 233 color 1 1 1;
  40. #X obj 198 50 line 0 40;
  41. #X connect 0 0 2 0;
  42. #X connect 2 0 3 0;
  43. #X connect 3 0 6 0;
  44. #X connect 4 0 5 0;
  45. #X connect 5 0 7 0;
  46. #X connect 6 0 17 0;
  47. #X connect 7 0 18 0;
  48. #X connect 8 0 3 3;
  49. #X connect 8 0 3 2;
  50. #X connect 8 0 3 1;
  51. #X connect 9 0 11 0;
  52. #X connect 9 0 5 0;
  53. #X connect 10 0 11 0;
  54. #X connect 11 0 15 0;
  55. #X connect 12 0 13 0;
  56. #X connect 13 0 14 0;
  57. #X connect 14 0 2 1;
  58. #X connect 15 0 16 0;
  59. #X connect 16 0 12 1;
  60. #X connect 17 0 1 0;
  61. #X connect 18 0 8 0;
  62. #X connect 18 0 12 0;
  63. #X restore 43 498 pd teapot-movement;
  64. #X obj 53 241 cnv 15 230 200 empty empty empty 2 8 0 10 -191407 -66577
  65. 0;
  66. #X obj 173 365 pix_texture;
  67. #X obj 173 388 rectangle 3 3;
  68. #X obj 61 295 tgl 15 0 empty empty show_content_of_frambuffer 17 7
  69. 0 10 -262144 -1 -1 0 1;
  70. #X obj 14 47 cnv 15 80 40 empty empty declare_paths 2 8 0 10 -258113
  71. -262144 0;
  72. #N canvas 518 150 548 468 init 1;
  73. #X obj 56 92 loadbang;
  74. #X obj 44 -23 cnv 15 400 100 empty empty IMPORTANT 20 12 0 14 -261234
  75. -66577 0;
  76. #X text 49 -3 Such a declare object should always be in the main patch
  77. of your project \, to set the pathes to the abstractions.;
  78. #X text 159 170 load the preset file on startup:;
  79. #X text 66 272 Recall scene '0' from the loaded preset file \, and
  80. load the still image files.;
  81. #X obj 158 43 ev-main/ev_declare;
  82. #X obj 56 144 t b b;
  83. #X obj 83 168 del 1000;
  84. #X obj 56 231 del 3000;
  85. #X text 157 223 (pathes relative to "./libs/kollabs");
  86. #X msg 83 190 \; /ds/0/loadfile ../../data/ev_example_3d_preset.txt
  87. ;
  88. #X msg 56 308 \; /ds/0/scene 0 \;;
  89. #X connect 0 0 6 0;
  90. #X connect 6 0 8 0;
  91. #X connect 6 1 7 0;
  92. #X connect 7 0 10 0;
  93. #X connect 8 0 11 0;
  94. #X restore 32 64 pd init;
  95. #X obj 294 241 cnv 15 350 370 empty empty projection_planes 20 12 0
  96. 14 -262130 -66577 0;
  97. #X obj 582 354 t a;
  98. #X obj 313 353 gemhead 50;
  99. #X obj 313 385 t a a a;
  100. #X obj 582 241 t a;
  101. #X obj 313 328 tgl 15 1 empty empty toggle_projection_planes 17 7 0
  102. 10 -262144 -1 -1 1 1;
  103. #X text 372 190 send the texture id of the \; framebuffer to the projection
  104. modules;
  105. #X text 477 14 (c)2011 Peter Venus & Marian Weger \; /part of EXTENDED
  106. VIEW toolkit/ gpl v3;
  107. #X text 109 46 This example shows how to project 3d renderings with
  108. the Extended View Toolkit.;
  109. #X text 666 226 orange framebuffer background:;
  110. #X text 670 432 "ev_example_3d_preset.txt";
  111. #X obj 675 450 ev_storage;
  112. #X obj 43 139 ev_buf 0;
  113. #X obj 313 545 ev_pro_22 l;
  114. #X obj 373 484 ev_pro_22 c;
  115. #X obj 350 97 ev_gemwin;
  116. #X obj 313 282 loadbang;
  117. #X msg 313 304 1;
  118. #X obj 61 252 loadbang;
  119. #X msg 61 275 0;
  120. #X obj 173 340 gemhead 99;
  121. #X text 39 602 For 3d objects \, some light is needed:;
  122. #X text 139 536 Simple 3d object;
  123. #X text 566 76 click "create" to start;
  124. #X obj 396 425 ev_pro_22 r;
  125. #X text 670 419 This example uses scene "0" of;
  126. #X text 672 601 Presets are lcated in the;
  127. #X text 672 614 "./data" folder.;
  128. #X connect 1 0 0 0;
  129. #X connect 4 0 3 0;
  130. #X connect 5 0 6 0;
  131. #X connect 6 0 4 0;
  132. #X connect 7 0 29 0;
  133. #X connect 10 0 9 0;
  134. #X connect 12 0 13 0;
  135. #X connect 14 0 37 0;
  136. #X connect 18 0 30 1;
  137. #X connect 18 0 31 1;
  138. #X connect 18 0 41 1;
  139. #X connect 19 0 20 0;
  140. #X connect 20 0 30 0;
  141. #X connect 20 1 31 0;
  142. #X connect 20 2 41 0;
  143. #X connect 21 0 18 0;
  144. #X connect 22 0 19 0;
  145. #X connect 29 0 10 0;
  146. #X connect 29 1 12 1;
  147. #X connect 29 1 21 0;
  148. #X connect 33 0 34 0;
  149. #X connect 34 0 22 0;
  150. #X connect 35 0 36 0;
  151. #X connect 36 0 14 0;
  152. #X connect 37 0 12 0;
  153. #X coords 0 0 1 1 85 60 0;