Forums > Jitter

[ANN] jit.gl.lua Beta 1

January 25, 2007 | 7:53 am

Hi Everyone,
I’m happy to announce the release of jit.gl.lua Beta 1 for OSX and
Windows. jit.gl.lua uses Lua scripts to interface with OpenGL as well
as Jitter. It’s very similar to the js object with a few important
differences. jit.gl.lua provides direct access to OpenGL so there is
no need to go through jit.gl.sketch to call OpenGL functions. It also
provides alot of C functions from the Jitter API that are normally
only available if you write an external.

For those of you not familiar with Lua, see http://www.lua.org. Lua is a
very fast scripting language that is slowly gaining in popularity
because of its portability, flexibility, and speed. The concept
behind jit.gl.lua is to allow Jitter users to mix both Jitter objects
and low-level C functions dynamically within a patcher. This allows
for greater precision in building constructs in a patch (especially in
OpenGL) as well as a potential speed boost since lightweight calls to
OpenGL can be used in place of relying on Jitter objects to maintain
OpenGL state.

In addition to loading Lua scripts, jit.gl.lua can load compiled C
modules (on OSX only right now) that extend its capabilites. The
modules can be as simple as 1 function or as complex as the heart
desires. The point is that you don’t have to write an entire Max or
Jitter object to get the performance benefits of having something run
in C to get it into Jitter anymore if what you’re trying to do doesn’t
warrant a full blown external.

Please keep in mind that jit.gl.lua is in Beta still so things could
change in a future version, although the object has been stable for
time now so major changes unlikely. However, since it is in beta, any
suggestions and especially bug reports are welcome. Also, if you find
the documentation lacking or have any questions, please feel free to
ask. The best resource on Lua is the Programming in Lua book
(http://www.lua.org/docs.html). For writing Lua scripts, I highly
reccommend SubEthaEdit because it has built in syntax highlighting as
well as a synax checking function which is very very useful. If you
install SubEthaEdit, it will prevent OSX from recognizing max
externals as such. To remedy this, install DefaultApps
(http://www.rubicode.com/Software/RCDefaultApp/)

The download can be found on my C74 share page at:

http://cycling74.com/twiki/bin/view/Share/WesleySmith?t=2007-01-24T23:05Z?rev=1.1

Externals, documentation, help files, and example patches are all in
the jit.gl.lua_beta1.zip.

cheers,
wes



MJ
January 25, 2007 | 2:24 pm

hmm sound great

but cycling74 seems to be down,any other dl spot?

-mj

>Hi Everyone,
>I’m happy to announce the release of jit.gl.lua Beta 1 for OSX and
>Windows. jit.gl.lua uses Lua scripts to interface with OpenGL as well
>as Jitter. It’s very similar to the js object with a few important
>differences. jit.gl.lua provides direct access to OpenGL so there is
>no need to go through jit.gl.sketch to call OpenGL functions. It also
>provides alot of C functions from the Jitter API that are normally
>only available if you write an external.
>
>For those of you not familiar with Lua, see http://www.lua.org. Lua is a
>very fast scripting language that is slowly gaining in popularity
>because of its portability, flexibility, and speed. The concept
>behind jit.gl.lua is to allow Jitter users to mix both Jitter objects
>and low-level C functions dynamically within a patcher. This allows
>for greater precision in building constructs in a patch (especially in
>OpenGL) as well as a potential speed boost since lightweight calls to
>OpenGL can be used in place of relying on Jitter objects to maintain
>OpenGL state.
>
>In addition to loading Lua scripts, jit.gl.lua can load compiled C
>modules (on OSX only right now) that extend its capabilites. The
>modules can be as simple as 1 function or as complex as the heart
>desires. The point is that you don’t have to write an entire Max or
>Jitter object to get the performance benefits of having something run
>in C to get it into Jitter anymore if what you’re trying to do doesn’t
>warrant a full blown external.
>
>Please keep in mind that jit.gl.lua is in Beta still so things could
>change in a future version, although the object has been stable for
>time now so major changes unlikely. However, since it is in beta, any
>suggestions and especially bug reports are welcome. Also, if you find
>the documentation lacking or have any questions, please feel free to
>ask. The best resource on Lua is the Programming in Lua book
>(http://www.lua.org/docs.html). For writing Lua scripts, I highly
>reccommend SubEthaEdit because it has built in syntax highlighting as
>well as a synax checking function which is very very useful. If you
>install SubEthaEdit, it will prevent OSX from recognizing max
>externals as such. To remedy this, install DefaultApps
>(http://www.rubicode.com/Software/RCDefaultApp/)
>
>The download can be found on my C74 share page at:
>http://cycling74.com/twiki/bin/view/Share/WesleySmith?t=2007-01-24T23:05Z?rev=1.1
>
>Externals, documentation, help files, and example patches are all in
>the jit.gl.lua_beta1.zip.
>
>cheers,
>wes


January 25, 2007 | 4:29 pm

Should be up now if it wasn’t earlier.

wes


January 26, 2007 | 11:08 am


January 26, 2007 | 4:22 pm

Hi Eric,
Did you look in the SubmatrixTest.lua script? Here’ it is:

submat = jit.submatrix()
submat.offset = {40, 40}
submat.dim = {60, 60}

submat2 = jit.submatrix()
submat2.offset = {40, 40}
submat2.dim = {80, 80}

spreadOffset = {0, 0}

robcross = jit.new("jit.robcross")

function jit_matrix(name)
submat:frommatrix(name)
submat2:frommatrix(name)
robcross:matrixcalc({submat.name}, {submat2.name})

outlet(0, "jit_matrix", submat.name)
end

function offset(…)
submat.offset = {…}
spread(spreadOffset[1], spreadOffset[2])
end

function spread(x, y)
spreadOffset = {x, y}
submat2.offset = vec2.add(spreadOffset, submat.offset)
end

if you change these lines:
submat.dim = {60, 60}

This sets the jit.submatrix object’s "dim" attribute just like in a
patcher. Does changing the numbers not work for you? It works here.

cheers,
wes


January 26, 2007 | 5:47 pm


January 26, 2007 | 6:03 pm

Fair enough. Just like in JS, if you add a function to the script,
you can call it as a message from max. Here’s a function for the dim
message. You may want a different one for each of the submatirces:

function dim(x, y)
submat.dim = {x, y}
submat2.dim = {x, y}
end

wes


April 28, 2008 | 9:58 pm

Hello !

I work with jit.lua.gl and i wonder if it’s possible to draw the glut 3d primitives (like GlutCylinder for example) and render text?
I’ve implemented most of the possibilities of this great object, but i don’t know if these functionnalities are accessible. Is this possible to load a compiled luagl.dll in a lua script used in max/msp ?

Best regards and congratulations for this great stuff ! ;-)

Emilien


April 28, 2008 | 10:23 pm

Hi,
These things are not there. You can easily use jit.gl.gridshape for
the same purposes (except for Teapot)
wes

On Mon, Apr 28, 2008 at 2:58 PM, Milou wrote:
>
> Hello !
>
> I work with jit.lua.gl and i wonder if it’s possible to draw the glut 3d primitives (like GlutCylinder for example) and render text?
> I’ve implemented most of the possibilities of this great object, but i don’t know if these functionnalities are accessible. Is this possible to load a compiled luagl.dll in a lua script used in max/msp ?
>
> Best regards and congratulations for this great stuff ! ;-)
>
> Emilien
>
>
>


Viewing 9 posts - 1 through 9 (of 9 total)