<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Pro-G &#187; LUA</title>
	<atom:link href="http://projets.ch/wp/blog/tag/lua/feed/" rel="self" type="application/rss+xml" />
	<link>http://projets.ch/wp</link>
	<description>Accélérateur d'Innovation</description>
	<lastBuildDate>Tue, 24 Jun 2008 08:00:50 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>GLua library.</title>
		<link>http://projets.ch/wp/blog/43/</link>
		<comments>http://projets.ch/wp/blog/43/#comments</comments>
		<pubDate>Fri, 21 Mar 2008 08:47:02 +0000</pubDate>
		<dc:creator>Philippe Guglielmetti</dc:creator>
				<category><![CDATA[3D]]></category>
		<category><![CDATA[programmation]]></category>
		<category><![CDATA[Demoniak3D]]></category>
		<category><![CDATA[LUA]]></category>

		<guid isPermaLink="false">http://projets.ch/wp/?p=43</guid>
		<description><![CDATA[GLua is an open source library which provides LUA programmers with classes and functions that mimic those available in GLSL, the OpenGL Shading Language.
GLua was especially designed as a base library for the Demoniak3D real-time engine, as it provides a consistent framework with GLSL shaders.

]]></description>
			<content:encoded><![CDATA[<p>GLua is an open source library which provides LUA programmers with classes and functions that mimic those available in GLSL, the OpenGL Shading Language.</p>
<p>GLua was especially designed as a base library for the Demoniak3D real-time engine, as it provides a consistent framework with GLSL shaders.
</ul>
]]></content:encoded>
			<wfw:commentRss>http://projets.ch/wp/blog/43/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>GLua library</title>
		<link>http://projets.ch/wp/blog/10/</link>
		<comments>http://projets.ch/wp/blog/10/#comments</comments>
		<pubDate>Thu, 20 Mar 2008 16:10:52 +0000</pubDate>
		<dc:creator>Philippe Guglielmetti</dc:creator>
				<category><![CDATA[3D]]></category>
		<category><![CDATA[programmation]]></category>
		<category><![CDATA[Demoniak3D]]></category>
		<category><![CDATA[LUA]]></category>

		<guid isPermaLink="false">http://projets.ch/wp/blog/2008/03/20/librairie-glua/</guid>
		<description><![CDATA[[french]GLua est une librairie open source qui offre au programmeurs LUA des classes et functions qui singent celles disponibles en GLSL, le "OpenGL Shading Language".[/french][english]GLua is an open source library which provides LUA programmers with classes and functions that mimic those available in GLSL, the OpenGL Shading Language.

GLua was especially designed as a base library for the Demoniak3D real-time engine, as it provides a consistent framework with GLSL shaders.[/english]

GLua a été spécialement conçue comme librairie de base pour Demoniak3D, pour fournir un ensemble cohérent avec les shaders GLSL.
]]></description>
			<content:encoded><![CDATA[<h3>Contents:</h3>
<ul>
<li>vec3.lua : 3D vectors and arithmetic</li>
<li>mat3.lua : 3D matrix and arithmetic</li>
<li>vec4.lua : 4D vectors and arithmetic</li>
<li>glsl.lua : generic functions following glsl prototypes as defined in book &#8220;OpenGL Shading Language&#8221; by Randi J. Rost</li>
<li>test.X.lua : unit test of module X</li>
</ul>
<h3>Usage &amp; Samples:</h3>
<p>Usage of the classes and functions is pretty straightforward.</p>
<p>Check the test.X.lua modules for more details or examples</p>
<h3>Download:</h3>
<p>GLua is available on <a href="http://luaforge.net/projects/glua/">http://luaforge.net/projects/glua/</a> under LGPL licence.</p>
<h3>Implementation details:</h3>
<ul>
<li>the classes are based on class.lua, described on <a href="http://lua-users.org/wiki/SimpleLuaClasses">http://lua-users.org/wiki/SimpleLuaClasses</a></li>
<li>glsl.lua offers generic function that work on LUA numbers and tables, and therefore all vector / matrix classes. It makes extensive use of functional programming to achieve this:
<ul>
<li>the &#8220;apply&#8221; function is defined as follows:<br />
<code>--- applies a function to a table of parameters<br />
-- @param f : function to apply to each element in v<br />
-- @param v : (vector of) parameter(s) to f function<br />
-- @return  : (vector of) result(s) of f(v)<br />
function apply(f,v)<br />
if type(v)=="number" then return f(v) end<br />
if type(v)=="table" then<br />
local res={}<br />
for i,x in ipairs(v) do res[i]=f(x) end<br />
return res<br />
end<br />
error("apply "..f.."("..type(v)..") not implemented")<br />
end</code></li>
<li>then, functions can easily be defined to support numbers, vectors, or matrices:<code><br />
function sin(rad)<br />
return apply(math.sin,rad)<br />
end</code></li>
</ul>
</li>
<li>dot product is implemented in 2 different ways :
<ul>
<li>through the &#8220;power&#8221; ^ operator in classes</li>
<li>as a generic dot(p1,p2) function in glsl.lua</li>
</ul>
</li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://projets.ch/wp/blog/10/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
