[PD] GEM GOP abstractions

Frank Barknecht fbar at footils.org
Mon Jun 12 12:13:42 CEST 2006


Hallo,
Chris McCormick hat gesagt: // Chris McCormick wrote:

> To address this I've been experimenting with a method of storing
> geometry in a [list] which is sent through geometry modifying
> "effects" to an object [sx/blob] which draws geometry represented as
> a list of verticies of triangles, to the screen. It's pretty crap
> and slow, and I'd love to know if there is already a better way of
> doing this.

Attached is a variation of your blob which I called "anyblob" because
it uses the "any-trick" to render multiple objects using just a single
gemhead. Note how [repeat] is replaced by [any] from IEMlib. The only
change necessary on the outside is, that you send 9-element triangle
lists seperately instead of packing them all into one long list. This
has several advantages. First it allows one to skip all this [list
split 9] business as well as the counting of the length of the list.
Second you can store the list of vertices into a [textfile] with one
triangle for each line and advance through it with [next(. Third: With
some more work it should possible to store single vertices with 3
coordinates on each line in this textfile, and then collect 3 lines on
every gemhead-bang. This basically is the format of an *.obj-file,
where vertices start with the letter "v". So with 

  [textfile] <= open some obj-file here
  |
  [route v]
  |
  [sx/objblob] <= TODO

you would get a custom, primitive obj-file renderer.

Ciao
-- 
 Frank Barknecht                 _ ______footils.org_ __goto10.org__
-------------- next part --------------
#N canvas 491 111 641 641 10;
#X obj 24 571 GEMglEnd;
#X obj 24 387 GEMglVertex3f -1 0 0;
#X obj 24 505 GEMglVertex3f 1 0 0;
#X obj 24 439 GEMglVertex3f 0 -1 0;
#X obj 89 187 loadbang;
#X obj 24 318 GEMglBegin;
#X obj 89 209 GLdefine GL_TRIANGLES;
#X obj 24 601 outlet;
#X obj 24 17 inlet;
#X obj 124 108 loadbang;
#X obj 24 153 GEMglShadeModel;
#X obj 124 130 GLdefine GL_FLAT;
#X obj 24 358 GEMglTexCoord3f 0 0 0;
#X obj 24 412 GEMglTexCoord3f 1 0 0;
#X obj 24 468 GEMglTexCoord3f 0 1 0;
#X obj 24 542 GEMglNormal3f;
#X obj 261 472 sx/normal;
#X obj 261 495 unpack f f f;
#N canvas 0 0 554 434 sep 0;
#X obj 74 76 inlet;
#X obj 74 270 separator;
#X obj 74 238 any;
#X obj 90 204 gemhead 45;
#X obj 74 99 t b a;
#X obj 74 312 outlet;
#X obj 104 164 outlet;
#X text 123 237 Important: number (45) must be less than incoming gemhead
;
#X connect 0 0 4 0;
#X connect 1 0 5 0;
#X connect 2 0 1 0;
#X connect 3 0 2 1;
#X connect 4 0 2 0;
#X connect 4 1 6 0;
#X restore 24 72 pd sep;
#X obj 231 335 unpack f f f f f f f f f;
#X obj 231 304 t a a;
#X connect 0 0 7 0;
#X connect 1 0 13 0;
#X connect 2 0 15 0;
#X connect 3 0 14 0;
#X connect 4 0 6 0;
#X connect 5 0 12 0;
#X connect 6 0 5 1;
#X connect 8 0 18 0;
#X connect 9 0 11 0;
#X connect 10 0 5 0;
#X connect 11 0 10 1;
#X connect 12 0 1 0;
#X connect 13 0 3 0;
#X connect 14 0 2 0;
#X connect 15 0 0 0;
#X connect 16 0 17 0;
#X connect 17 0 15 1;
#X connect 17 1 15 2;
#X connect 17 2 15 3;
#X connect 18 0 10 0;
#X connect 18 1 20 0;
#X connect 19 0 1 1;
#X connect 19 1 1 2;
#X connect 19 2 1 3;
#X connect 19 3 3 1;
#X connect 19 4 3 2;
#X connect 19 5 3 3;
#X connect 19 6 2 1;
#X connect 19 7 2 2;
#X connect 19 8 2 3;
#X connect 20 0 19 0;
#X connect 20 1 16 0;
-------------- next part --------------
#N canvas 156 122 562 420 10;
#X obj 20 42 sx/gemwin;
#X obj 161 27 gemhead;
#X obj 161 52 sx/props;
#X text 19 6 the blob takes a list of verticies of triangular faces
in the right inlet.;
#X text 17 355 You can use the blender export script in the;
#X obj 161 299 sx/anyblob;
#X obj 141 28 tgl 15 0 empty empty empty 0 -6 0 8 -262144 -1 -1 1 1
;
#X obj 161 220 f 0;
#X floatatom 251 197 5 0 0 0 - - -;
#X msg 161 240 -1 0 \$1 0 -1 0 1 0 0 \, -1 0 1 0 -1 1 1 0 1;
#X obj 161 168 b;
#X connect 1 0 2 0;
#X connect 2 0 10 0;
#X connect 6 0 1 0;
#X connect 7 0 9 0;
#X connect 8 0 7 1;
#X connect 9 0 5 0;
#X connect 10 0 7 0;


More information about the Pd-list mailing list