thanks wes, lua is so flexible<br><br>i&#39;m still having difficulties with the placement of <br>&nbsp; gl.Enable(&quot;BLEND&quot;)<br>&nbsp; gl.BlendFunc(1,6)<br>&nbsp; gl.ClearColor(0,0,0,0.5)<br>my intuition tells me it should be in the init function, but no go.
<br><br><div class="gmail_quote">On Jan 2, 2008 5:26 AM, Wesley Smith &lt;<a href="mailto:wesley.hoke@gmail.com" target="_blank">wesley.hoke@gmail.com</a>&gt; wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">

Sorry, there was a slight typo in my script in the last post. &nbsp;Here&#39;s<br>a fixed version:<br><div><div></div><div><br><br>autowatch = 1<br>print(&quot;compiled&quot;)<br>render_context = this.drawto<br>
angle=0<br>mouseXY={0,0}<br>dir=1<br><br><br><br>function BuildLists()<br><br> &nbsp; &nbsp;box = gl.GenLists(2)<br> &nbsp; &nbsp;gl.NewList(box &nbsp; &nbsp;,&quot;COMPILE&quot;);<br> &nbsp; &nbsp; &nbsp; &nbsp;gl.Begin(&quot;QUADS&quot;)<br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;gl.Vertex (-0.5
 , 
0.5 , 0. ) &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;-- Top Left<br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;gl.Vertex ( 0.5 , 0.5 , 0. ) &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;-- Top Right<br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;gl.Vertex ( 0.5 ,-0.5 , 0. ) &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;-- Bottom Right<br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;gl.Vertex (-0.5 ,-0.5 , 0. )
<br> &nbsp; &nbsp; &nbsp; &nbsp;gl.End();<br> &nbsp; &nbsp;gl.EndList()<br>end<br>function init()<br>--initialize the dispaly list<br> &nbsp; &nbsp; &nbsp; &nbsp;if(this.context ~= 0) then<br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;BuildLists()<br> &nbsp; &nbsp; &nbsp; &nbsp;end<br>end<br><br><br>-- functions as variables!
<br>function setOnReloadOrDestChanged(func)<br> &nbsp; &nbsp; &nbsp; &nbsp;script_load = func<br></div></div> &nbsp; &nbsp; &nbsp; &nbsp;dest_changed = func<br><div><div></div><div>end<br>setOnReloadOrDestChanged(init)<br><br>--[[<br>This section is equivalent to the above
<br><br>function script_load()<br> &nbsp; &nbsp; &nbsp; &nbsp;init()<br>end<br><br>function dest_changed()<br> &nbsp; &nbsp; &nbsp; &nbsp;init()<br>end<br>--]]<br><br>function draw()<br> &nbsp; &nbsp;gl.Clear(&quot;COLOR_BUFFER_BIT&quot; , &quot;DEPTH_BUFFER_BIT&quot;)<br>

 &nbsp; &nbsp;--gl.LoadIdentity()<br> &nbsp; &nbsp;--gl.Enable(&quot;BLEND&quot;)<br> &nbsp; &nbsp;--gl.BlendFunc(1,6)<br> &nbsp; &nbsp;--gl.ClearColor(1,1,0,1)<br> &nbsp; &nbsp;rot()<br> &nbsp; &nbsp;for i=0,1000 do<br> &nbsp; &nbsp;gl.Translate(mouseXY[1],mouseXY[2],(i/1000)-1);<br> &nbsp; &nbsp;gl.Rotate

(angle,0,0,1)<br> &nbsp; &nbsp;gl.Color(i/1000, math.random(), 1, i/1000)<br> &nbsp; &nbsp;gl.CallList(box)<br> &nbsp; &nbsp;end<br><br>end<br><br>function rot()<br> &nbsp; &nbsp;angle = angle+dir<br> &nbsp; &nbsp;if angle==15 then dir= -0.5<br> &nbsp; &nbsp;elseif angle==0 then dir= 
0.5<br> &nbsp; &nbsp;end<br>end<br><br>--create the listener callback function<br>function callback(event)<br> &nbsp; &nbsp;if(event.eventname == &quot;mouseidle&quot;) then<br> &nbsp; &nbsp; &nbsp; &nbsp;local _glXmouse = event.args[1]<br> &nbsp; &nbsp; &nbsp; &nbsp;local _glYmouse = 
event.args[2]<br> &nbsp; &nbsp; &nbsp; &nbsp;--need to transform mouse ccordinates to world domain<br> &nbsp; &nbsp; &nbsp; &nbsp;--dono why, but 0.95 needed<br> &nbsp; &nbsp; &nbsp; &nbsp;mouseXY=jit.gl.screentoworld({_glXmouse,_glYmouse, 0.95})<br> &nbsp; &nbsp;end<br>end<br><br>--create a listener object
<br>listener = jit.listener(render_context, &quot;callback&quot;)<br>_______________________________________________<br>jitter mailing list<br><a href="mailto:jitter@cycling74.com" target="_blank">jitter@cycling74.com</a>
<br><a href="http://www.cycling74.com/mailman/listinfo/jitter" target="_blank">
http://www.cycling74.com/mailman/listinfo/jitter</a><br></div></div></blockquote></div><br>