[fluxus] indexed mode polys

dave dave at pawfal.org
Sun May 27 06:35:52 PDT 2007


Hi all,

I've added indexed mode polygons (at last) which allow pdata vertex
information to be reused in a polygon primitive. This is done by
indexing into the vertex data with another list (the index list) which
specifies which vertices make up each face. 

The way we've been doing it so far (flat arrays) are much easier to
generate procedurally, but slower to process, deform etc - so I've added
a conversion (poly-convert-to-indexed) to build the index list
automatically (by joining close verts) so we can have the best of both
worlds.

In the case of the poly-sphere:

(define p (build-sphere 10 10))

(grab p)
(display (pdata-size))(newline) => 600
(poly-convert-to-indexed)
(display (pdata-size))(newline) => 92
(ungrab)

So this results in less than a sixth of the vertex data, which would
speed up processing by six times! However they do take (very slightly)
more time to render. 

In a real world example (09-toon2.scm) adding (poly-convert-to-indexed)
goes from 26 to 110 fps on my machine - not bad...

You can also specify the list explicitly, using a new command
(poly-set-index index-list) - see the documentation for an example
script.

This should make a lot of things (eg loading from .obj file) much
easier.

cheers,

dave







More information about the Fluxus mailing list