[GEM-dev] vertex proposals

IOhannes m zmoelnig zmoelnig at iem.at
Thu Aug 26 12:26:45 CEST 2004


things i'd like to discuss


general
=======


[vertex_add] (and all other objects i have done so far) can be applied 
to all 4 arrays; this is, you can add the vertexArray of the lefthand 
gemlist to the colorArray to the righthand gemlist.

naively i have assumed that all arrays are of the same dimension, which 
is not true; texCoordArray is [Nx2] and normalArray is [Nx3], the rest 
is [Nx4];
this is certainly more memory-efficient.

however, i would propose to unify all arrays to [Nx4];
why ?
1) i can apply a single processVertex-function to all arrays without 
having to know anything about the type of data (this reminds me strongly 
of the "generalized 3d shape synthesizer")
2) there shouldn't be a problem with memory nowadays.
3) operations on the normalArray is probably faster than with [Nx3] 
(given that SIMD needs aligned memory)
why not ?
1) unifying means the the colorArray would most likely stay float 
instead of becoming int
2) the texCoordArray doubles

probably it would be best to define just a number of [Nx4] arrays (with 
no data types at all)
[vertex_model] would then load 4 arrays (vertex, color, normals, 
texcoords), [vertex_draw] would interprete them according to these defaults.
simple generators like [vertex_random] would only create one array which 
could then be assigned to whatever.


objects
=======
(just what comes to my mind is useful)

_sources_: OBJ-loader, grid, quad, supershape, random, sphere,...
_sinks_: draw, OBJ-exporter
_manips_(with only a lefthand gemlist): add(=offset), scale, set, 
matrix-multiplication, rotation
_manips2_(with 2 gemlists): add, mul, set, blend
_misc_: info, merge (e.g. take array1 of gemlist1 as color and array4 of 
gemlist2 as vertex)


gosh there were so many; i have forgotten them right now...


mf.a.sdr
IOhannes









More information about the GEM-dev mailing list