{"id":1134,"date":"2014-01-27T01:37:26","date_gmt":"2014-01-26T16:37:26","guid":{"rendered":"http:\/\/mirror.boy.jp\/?p=1134"},"modified":"2014-01-27T01:38:16","modified_gmt":"2014-01-26T16:38:16","slug":"jit-gl-lua-%e3%81%a7%e5%85%89%e6%ba%90%e3%83%bb%e3%83%9e%e3%83%86%e3%83%aa%e3%82%a2%e3%83%ab%e3%82%92%e8%a8%ad%e5%ae%9a%e3%81%97%e3%81%a6%e6%8f%8f%e7%94%bb%ef%bc%9acycling74-maxopengljitter","status":"publish","type":"post","link":"https:\/\/mirror.boy.jp\/?p=1134","title":{"rendered":"jit.gl.lua \u3067\u5149\u6e90\u30fb\u30de\u30c6\u30ea\u30a2\u30eb\u3092\u8a2d\u5b9a\u3057\u3066\u63cf\u753b\uff1aCycling&#8217;74 Max,OpenGL,Jitter"},"content":{"rendered":"<p><a onclick=\"javascript:pageTracker._trackPageview('\/downloads\/wp-content\/uploads\/2014\/01\/\u30b9\u30af\u30ea\u30fc\u30f3\u30b7\u30e7\u30c3\u30c8-2014-01-27-01.30.13.jpeg');\"  href=\"http:\/\/mirror.boy.jp\/wp-content\/uploads\/2014\/01\/\u30b9\u30af\u30ea\u30fc\u30f3\u30b7\u30e7\u30c3\u30c8-2014-01-27-01.30.13.jpeg\"><img loading=\"lazy\" decoding=\"async\" alt=\"\u30b9\u30af\u30ea\u30fc\u30f3\u30b7\u30e7\u30c3\u30c8 2014-01-27 01.30.13\" src=\"http:\/\/mirror.boy.jp\/wp-content\/uploads\/2014\/01\/\u30b9\u30af\u30ea\u30fc\u30f3\u30b7\u30e7\u30c3\u30c8-2014-01-27-01.30.13-1024x803.jpeg\" width=\"1024\" height=\"803\" \/><\/a><\/p>\n<p>[javascript]<\/p>\n<p>this.autowatch = 1<br \/>\nthis.gc = 1<\/p>\n<p>local gl = require(&quot;opengl&quot;)<br \/>\nlocal glu = require(&quot;opengl.glu&quot;)<br \/>\nlocal GL = gl<br \/>\nlocal GLU = glu;<br \/>\nlocal _analogIn = {};<\/p>\n<p>local vertexes = {<br \/>\n {-0.5,0.5,0.5},<br \/>\n {-0.5,-0.5,0.5},<br \/>\n {0.5,-0.5,0.5},<br \/>\n {0.5,0.5,0.5},<br \/>\n {-0.5,0.5,-0.5},<br \/>\n {-0.5,-0.5,-0.5},<br \/>\n {0.5,-0.5,-0.5},<br \/>\n {0.5,0.5,-0.5}<br \/>\n};<\/p>\n<p>local lightAmb = {0,0,0,1}<br \/>\nlocal lightDiff = {1,1,1,1}<br \/>\nlocal lightSpec = {1,1,1,1}<br \/>\nlocal lightPos = {1,1,1,0}<\/p>\n<p>local goldAmb = {0.24725,0.1995,0.0745,1}<br \/>\nlocal goldDiff = {0.75164,0.60648,0.22648,1};<br \/>\nlocal goldSpec = {0.628281,0.555802,0.366065,1};<br \/>\nlocal goldShin = 51.2;<\/p>\n<p>local _rot = {0,0,0};<br \/>\nlocal angle = 0;<\/p>\n<p>function rot(&#8230;)<\/p>\n<p> _rot = {&#8230;};<br \/>\nend<\/p>\n<p>function drawCube()<\/p>\n<p> &#8211;top<br \/>\n gl.Normal(0,1,0);<br \/>\n gl.Begin(GL.QUADS);<br \/>\n gl.Vertex(vertexes[1])<br \/>\n gl.Vertex(vertexes[4])<br \/>\n gl.Vertex(vertexes[8])<br \/>\n gl.Vertex(vertexes[5])<br \/>\n gl.End();<\/p>\n<p> &#8211;buttom<br \/>\n gl.Normal(0,-1,0)<br \/>\n gl.Begin(GL.QUADS)<br \/>\n gl.Vertex(vertexes[6])<br \/>\n gl.Vertex(vertexes[7]);<br \/>\n gl.Vertex(vertexes[3]);<br \/>\n gl.Vertex(vertexes[2]);<br \/>\n gl.End()<\/p>\n<p> &#8211;front<br \/>\n gl.Normal(0,0,1)<br \/>\n gl.Begin(GL.QUADS)<br \/>\n gl.Vertex(vertexes[1])<br \/>\n gl.Vertex(vertexes[2])<br \/>\n gl.Vertex(vertexes[3])<br \/>\n gl.Vertex(vertexes[4])<br \/>\n gl.End()<\/p>\n<p> &#8211;back<br \/>\n gl.Normal(0,0,-1)<br \/>\n gl.Begin(GL.QUADS)<br \/>\n gl.Vertex(vertexes[5])<br \/>\n gl.Vertex(vertexes[8])<br \/>\n gl.Vertex(vertexes[7])<br \/>\n gl.Vertex(vertexes[6])<br \/>\n gl.End()<\/p>\n<p> &#8211;left<br \/>\n gl.Normal(-1,0,0)<br \/>\n gl.Begin(GL.QUADS)<br \/>\n gl.Vertex(vertexes[1])<br \/>\n gl.Vertex(vertexes[5])<br \/>\n gl.Vertex(vertexes[6])<br \/>\n gl.Vertex(vertexes[2])<br \/>\n gl.End()<\/p>\n<p> &#8211;right<br \/>\n gl.Normal(1,0,0)<br \/>\n gl.Begin(GL.QUADS)<br \/>\n gl.Vertex(vertexes[4])<br \/>\n gl.Vertex(vertexes[3])<br \/>\n gl.Vertex(vertexes[7])<br \/>\n gl.Vertex(vertexes[8])<br \/>\n gl.End()<\/p>\n<p>end<\/p>\n<p>function scriptload()<\/p>\n<p> print(&quot;scriptload&quot;);<\/p>\n<p>end<\/p>\n<p>function draw()<\/p>\n<p> &#8211;init<br \/>\n gl.ClearColor(1,1,1,1)<br \/>\n gl.ClearDepth(1)<br \/>\n gl.Enable(GL.DEPTH_TEST)<\/p>\n<p> gl.Light(GL.LIGHT0,GL.AMBIENT,lightAmb)<br \/>\n gl.Light(GL.LIGHT0,GL.DIFFUSE,lightDiff)<br \/>\n gl.Light(GL.LIGHT0,GL.SPECULAR,lightSpec)<\/p>\n<p> gl.Enable(GL.LIGHT0)<br \/>\n gl.Enable(GL.LIGHTING)<br \/>\n gl.Enable(GL.NORMALIZE)<\/p>\n<p> gl.Clear(GL.COLOR_BUFFER_BIT,GL.DEPTH_BUFFER_BIT)<br \/>\n gl.LoadIdentity();<br \/>\n glu.LookAt({0,0,2},{0,0,0},{0,1,0});<\/p>\n<p> &#8211;light<br \/>\n gl.Light(GL.LIGHT0,GL.POSITION,lightPos)<\/p>\n<p> gl.PushMatrix()<br \/>\n gl.Rotate(_rot)<\/p>\n<p>&#8212; gl.Rotate(angle,0,1,0)<br \/>\n gl.Material(GL.FRONT_AND_BACK,GL.AMBIENT,goldAmb);<br \/>\n gl.Material(GL.FRONT_AND_BACK,GL.DIFFUSE,goldDiff);<br \/>\n gl.Material(GL.FRONT_AND_BACK,GL.SPECULAR,goldSpec)<br \/>\n gl.Material(GL.FRONT_AND_BACK,GL.SHININESS,goldShin);<\/p>\n<p> drawCube();<\/p>\n<p> gl.PopMatrix()<\/p>\n<p> angle = angle + 1;<br \/>\n if angle &gt;= 360 then angle = 0 end<\/p>\n<p>end<br \/>\n[\/javascript]<\/p>\n<h3>\u53c2\u8003\u56f3\u66f8<\/h3>\n<p><a onclick=\"javascript:pageTracker._trackPageview('\/outgoing\/www.amazon.co.jp\/gp\/product\/4777516792?ie=UTF8&amp;camp=1207&amp;creative=8411&amp;creativeASIN=4777516792&amp;linkCode=shr&amp;tag=technomusicna-22');\"  href=\"http:\/\/www.amazon.co.jp\/gp\/product\/4777516792?ie=UTF8&amp;camp=1207&amp;creative=8411&amp;creativeASIN=4777516792&amp;linkCode=shr&amp;tag=technomusicna-22\">\u306f\u3058\u3081\u3066\u306eOpenGL\u2015\u30e9\u30a4\u30d6\u30e9\u30ea\u3092\u4f7f\u3063\u305f\u300c3D\u2010CG\u30d7\u30ed\u30b0\u30e9\u30df\u30f3\u30b0\u300d\u306e\u57fa\u672c\u00a0<\/a>\u00a0&#8211; p.131 \u304b\u3089\u306e\u30b5\u30f3\u30d7\u30eb\u3092\u5229\u7528\u3057\u307e\u3057\u305f\u3002Max\u306eOpenGL\u3068\u30d0\u30fc\u30b8\u30e7\u30f3\u304c\u3042\u3063\u3066\u3044\u308b\u305f\u3081\u3001\u3053\u306e\u66f8\u7c4d\u306f\u52c9\u5f37\u3057\u3084\u3059\u3044\u3067\u3059\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>[javascript] this.autowatch = 1 this.gc = 1 local gl = require(&quot;opengl&quot;) local glu = require(&quot;o &hellip; <a href=\"https:\/\/mirror.boy.jp\/?p=1134\" class=\"more-link\">\u7d9a\u304d\u3092\u8aad\u3080 <span class=\"screen-reader-text\">jit.gl.lua \u3067\u5149\u6e90\u30fb\u30de\u30c6\u30ea\u30a2\u30eb\u3092\u8a2d\u5b9a\u3057\u3066\u63cf\u753b\uff1aCycling&#8217;74 Max,OpenGL,Jitter<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[8,47,45,26],"tags":[],"_links":{"self":[{"href":"https:\/\/mirror.boy.jp\/index.php?rest_route=\/wp\/v2\/posts\/1134"}],"collection":[{"href":"https:\/\/mirror.boy.jp\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/mirror.boy.jp\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/mirror.boy.jp\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/mirror.boy.jp\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=1134"}],"version-history":[{"count":2,"href":"https:\/\/mirror.boy.jp\/index.php?rest_route=\/wp\/v2\/posts\/1134\/revisions"}],"predecessor-version":[{"id":1137,"href":"https:\/\/mirror.boy.jp\/index.php?rest_route=\/wp\/v2\/posts\/1134\/revisions\/1137"}],"wp:attachment":[{"href":"https:\/\/mirror.boy.jp\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1134"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/mirror.boy.jp\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=1134"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/mirror.boy.jp\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=1134"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}