[GEM-dev] automated drawing in gem?

B. Bogart ben at ekran.org
Wed Sep 19 17:57:24 CEST 2007


Indeed it does,

I find this thread interesting because of the drawing I've been doing
has been with stuff like texture feedback and repeat.

I started doing stuff with the gl headers, but what was missing (I
realized) was the ability to create open-ended objects. Like a spline
that gets longer and longer over time.

This means there would need to be more and more vertex() functions
between glbegin() and glend() per frame.

Using the wrappers it means that a gemchain would get longer and longer
over time, and have to be dynamically built. Possible, but certainly
irritating.

The best "drawing" solution I can think of is an object that has an
internal display list that operations (function calls) can be added to
and removed from (like a linklist maybe). for example:

[12<
 |
[until]
 |
[t f f]
 |   |
 |  [random] # abstraction that sends 3 random numbers in a list
 |   | | |
[pack f f f f]
 |
[add $1 vertex $2 $3 $4] # $1 is the index of this entry
 |
[glDraw] (has glBegin and glEnd

You could set some of those wrapper flags (like GL_LINE_STRIP) via
messages to glDraw, and a "add" message or something would add something
to the linked list, that gets sorted and executed between glBegin and
glEnd for *each* render cycle.

So the patch above would create a static 12 vertex structure where the
vertex's are random, but not moving. You could add another vertex to it
by doing "remove 11" (where 11 would be the last index of the last
entry.) Insert could get ugly for managing the indexes...

Of course the number of vertexes would not be limitless, but it could do
a pretty nice job...

Perhaps the arguments to "add" would be something different than GL, so
each entry could be a vertex with all its attributes, rather than having
to have a separate entry for the vertex, and its colour.

Just thinking aloud...

B.


chris clepper wrote:
> On 9/19/07, *Frank Barknecht* <fbar at footils.org
> <mailto:fbar at footils.org>> wrote:
> 
>     This works?! Amazing. I just recently jumped onto the Lua train a
>     bit. I see that there are several GL-bindings for Lua. Is luagl the
>     one to use?
> 
> 
> Doesn't Python also have GL?
> 
> http://pyopengl.sourceforge.net/
> 
> Not sure if the calls require any special context to be created, but
> most things between glBegin() and glEnd() should work, albeit in a
> slightly dumb way.
> 
> 
> 
> 
> 
> ------------------------------------------------------------------------
> 
> _______________________________________________
> GEM-dev mailing list
> GEM-dev at iem.at
> http://lists.puredata.info/listinfo/gem-dev





More information about the GEM-dev mailing list