[GEM-dev] automated drawing in gem?
Frank Barknecht
fbar at footils.org
Wed Sep 19 15:42:32 CEST 2007
Hallo,
IOhannes m zmoelnig hat gesagt: // IOhannes m zmoelnig wrote:
> get lua
>
> get pdlua, compile it, read the examples
>
> get LuaGL, compile it (read
> http://sourceforge.net/tracker/index.php?func=detail&aid=1724422&group_id=85185&atid=575357
> for instructions)
>
> create a new lua-pdobject like this:
>
> """
> require('opengl')
>
> local luagl = pd.Class:new():register("luagl")
> function luagl:initialize(name, atoms)
> self.inlets = 1
> return true
> end
> function luagl:in_0(sel, atoms)
> if sel == "gem_state" then
> luagl:render()
> end
> end
> function luagl:render()
> gl.Begin("LINES")
> gl.Color(1, 1, 0)
> gl.Vertex(0, 0)
> gl.Vertex(1, 1)
> gl.End()
> end
> """
>
> load it.
> have fun.
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?
Ciao
--
Frank Barknecht _ ______footils.org_ __goto10.org__
More information about the GEM-dev
mailing list