<?xml version="1.0"?>
<rss version="2.0">
   <channel>
      <title>SMURF Augmented Reality by Aldo Nunez</title>
      <link>https://padlet.com/aldonunez319/dzp4ziqgmrxs</link>
      <description></description>
      <language>en-us</language>
      <pubDate>2018-01-16 18:22:16 UTC</pubDate>
      <lastBuildDate>2024-12-25 05:04:40 UTC</lastBuildDate>
      <webMaster>hello@padlet.com</webMaster>
      <image>
         <url>https://padlet-assets.s3.amazonaws.com/icons/Terminator.png</url>
      </image>
      <item>
         <title>AR Video</title>
         <author>aldonunez319</author>
         <link>https://padlet.com/aldonunez319/dzp4ziqgmrxs/wish/221831922</link>
         <description><![CDATA[<div><a href="https://www.useloom.com/share/7eaabcba6327425f9706fb66c9e908d3">https://www.useloom.com/share/7eaabcba6327425f9706fb66c9e908d3</a></div>]]></description>
         <enclosure url="" />
         <pubDate>2018-01-16 18:37:55 UTC</pubDate>
         <guid>https://padlet.com/aldonunez319/dzp4ziqgmrxs/wish/221831922</guid>
      </item>
      <item>
         <title>AR Virtual Buttons</title>
         <author>aldonunez319</author>
         <link>https://padlet.com/aldonunez319/dzp4ziqgmrxs/wish/221832817</link>
         <description><![CDATA[<div><a href="https://www.useloom.com/share/c73362f4053c474f9bef61d7af068816">https://www.useloom.com/share/c73362f4053c474f9bef61d7af068816</a></div>]]></description>
         <enclosure url="" />
         <pubDate>2018-01-16 18:39:53 UTC</pubDate>
         <guid>https://padlet.com/aldonunez319/dzp4ziqgmrxs/wish/221832817</guid>
      </item>
      <item>
         <title>AR PowerPoint</title>
         <author>aldonunez319</author>
         <link>https://padlet.com/aldonunez319/dzp4ziqgmrxs/wish/221835127</link>
         <description><![CDATA[]]></description>
         <enclosure url="https://padletuploads.blob.core.windows.net/prod/216811094/94a9edd553a3481d425be1117f261a54/AR.pptx" />
         <pubDate>2018-01-16 18:44:22 UTC</pubDate>
         <guid>https://padlet.com/aldonunez319/dzp4ziqgmrxs/wish/221835127</guid>
      </item>
      <item>
         <title>EXPLORATION WITH TREES</title>
         <author>aldonunez319</author>
         <link>https://padlet.com/aldonunez319/dzp4ziqgmrxs/wish/298853763</link>
         <description><![CDATA[<pre>&lt;!doctype <strong>html</strong>&gt;
&lt;<strong>html</strong>&gt;
&lt;<strong>body</strong>&gt;
&lt;<strong>canvas width = "300" height = "300" id = "my_Canvas"</strong>&gt;&lt;/<strong>canvas</strong>&gt;

&lt;<strong>script</strong>&gt;

    <em>/*======= Creating a canvas =========*/

    </em><strong>var </strong><strong><em>canvas </em></strong>= <strong>document</strong>.getElementById(<strong>'my_Canvas'</strong>);
    <strong>var </strong><strong><em>gl </em></strong>= <strong><em>canvas</em></strong>.getContext(<strong>'experimental-webgl'</strong>);


    <em>/*======= Defining and storing the geometry ======*/
/*
    var vertices = [
        -0.7,-0.1,0,
        -0.3,0.6,0,
        -0.3,-0.3,0,
        0.2,0.6,0,
        0.3,-0.3,0,
        0.7,0.6,0
    ]
*/
    </em><strong>var </strong><strong><em>L </em></strong>= 0.1;
    <strong>var </strong><strong><em>thetaDeg </em></strong>= 30.0;
    <strong>var </strong><strong><em>theta </em></strong>= (<strong><em>thetaDeg</em></strong>*<strong><em>Math</em></strong>.<strong>PI</strong>)/180.0;


    <strong>var </strong><strong><em>vertices </em></strong>= [
        0.0, 0.0, 0.0,
        0.0, <strong><em>L</em></strong>, 0.0,
        0.0, <strong><em>L</em></strong>, 0.0,
        -<strong><em>L</em></strong>*<strong><em>Math</em></strong>.sin(<strong><em>theta</em></strong>), <strong><em>L</em></strong>+<strong><em>L</em></strong>*<strong><em>Math</em></strong>.cos(<strong><em>theta</em></strong>), 0.0,
        0.0, <strong><em>L</em></strong>, 0.0,
        <strong><em>L</em></strong>*<strong><em>Math</em></strong>.sin(<strong><em>theta</em></strong>), <strong><em>L</em></strong>+<strong><em>L</em></strong>*<strong><em>Math</em></strong>.cos(<strong><em>theta</em></strong>), 0.0
    ]


    <em>// Create an empty buffer object
    </em><strong>var </strong><strong><em>vertex_buffer </em></strong>= <strong><em>gl</em></strong>.createBuffer();

    <em>// Bind appropriate array buffer to it
    </em><strong><em>gl</em></strong>.bindBuffer(<strong><em>gl</em></strong>.ARRAY_BUFFER, <strong><em>vertex_buffer</em></strong>);

    <em>// Pass the vertex data to the buffer
    </em><strong><em>gl</em></strong>.bufferData(<strong><em>gl</em></strong>.ARRAY_BUFFER, <strong>new </strong>Float32Array(<strong><em>vertices</em></strong>), <strong><em>gl</em></strong>.STATIC_DRAW);

    <em>// Unbind the buffer
    </em><strong><em>gl</em></strong>.bindBuffer(<strong><em>gl</em></strong>.ARRAY_BUFFER, <strong>null</strong>);

    <em>/*=================== Shaders ====================*/

    // Vertex shader source code
    </em><strong>var </strong><strong><em>vertCode </em></strong>=
        <strong>'attribute vec3 coordinates;' </strong>+
        <strong>'void main(void) {' </strong>+
        <strong>' gl_Position = vec4(coordinates, 1.0);' </strong>+
        <strong>' gl_PointSize = 10.0;' </strong>+
        <strong>'}'</strong>;

    <em>// Create a vertex shader object
    </em><strong>var </strong><strong><em>vertShader </em></strong>= <strong><em>gl</em></strong>.createShader(<strong><em>gl</em></strong>.VERTEX_SHADER);

    <em>// Attach vertex shader source code
    </em><strong><em>gl</em></strong>.shaderSource(<strong><em>vertShader</em></strong>, <strong><em>vertCode</em></strong>);

    <em>// Compile the vertex shader
    </em><strong><em>gl</em></strong>.compileShader(<strong><em>vertShader</em></strong>);

    <em>// Fragment shader source code
    </em><strong>var </strong><strong><em>fragCode </em></strong>=
        <strong>'void main(void) {' </strong>+
        <strong>'gl_FragColor = vec4(0.0, 0.0, 0.0, 0.1);' </strong>+
        <strong>'}'</strong>;

    <em>// Create fragment shader object
    </em><strong>var </strong><strong><em>fragShader </em></strong>= <strong><em>gl</em></strong>.createShader(<strong><em>gl</em></strong>.FRAGMENT_SHADER);

    <em>// Attach fragment shader source code
    </em><strong><em>gl</em></strong>.shaderSource(<strong><em>fragShader</em></strong>, <strong><em>fragCode</em></strong>);

    <em>// Compile the fragmentt shader
    </em><strong><em>gl</em></strong>.compileShader(<strong><em>fragShader</em></strong>);

    <em>// Create a shader program object to store
    // the combined shader program
    </em><strong>var </strong><strong><em>shaderProgram </em></strong>= <strong><em>gl</em></strong>.createProgram();

    <em>// Attach a vertex shader
    </em><strong><em>gl</em></strong>.attachShader(<strong><em>shaderProgram</em></strong>, <strong><em>vertShader</em></strong>);

    <em>// Attach a fragment shader
    </em><strong><em>gl</em></strong>.attachShader(<strong><em>shaderProgram</em></strong>, <strong><em>fragShader</em></strong>);

    <em>// Link both the programs
    </em><strong><em>gl</em></strong>.linkProgram(<strong><em>shaderProgram</em></strong>);

    <em>// Use the combined shader program object
    </em><strong><em>gl</em></strong>.useProgram(<strong><em>shaderProgram</em></strong>);

    <em>/*======= Associating shaders to buffer objects ======*/

    // Bind vertex buffer object
    </em><strong><em>gl</em></strong>.bindBuffer(<strong><em>gl</em></strong>.ARRAY_BUFFER, <strong><em>vertex_buffer</em></strong>);

    <em>// Get the attribute location
    </em><strong>var </strong><strong><em>coord </em></strong>= <strong><em>gl</em></strong>.getAttribLocation(<strong><em>shaderProgram</em></strong>, <strong>"coordinates"</strong>);

    <em>// Point an attribute to the currently bound VBO
    </em><strong><em>gl</em></strong>.vertexAttribPointer(<strong><em>coord</em></strong>, 3, <strong><em>gl</em></strong>.FLOAT, <strong>false</strong>, 0, 0);

    <em>// Enable the attribute
    </em><strong><em>gl</em></strong>.enableVertexAttribArray(<strong><em>coord</em></strong>);

    <em>/*============ Drawing the triangle =============*/

    // Clear the canvas
    </em><strong><em>gl</em></strong>.clearColor(0.5, 0.5, 0.5, 0.9);

    <em>// Enable the depth test
    </em><strong><em>gl</em></strong>.enable(<strong><em>gl</em></strong>.DEPTH_TEST);

    <em>// Clear the color and depth buffer
    </em><strong><em>gl</em></strong>.clear(<strong><em>gl</em></strong>.COLOR_BUFFER_BIT | <strong><em>gl</em></strong>.DEPTH_BUFFER_BIT);

    <em>// Set the view port
    </em><strong><em>gl</em></strong>.viewport(0,0,<strong><em>canvas</em></strong>.<strong>width</strong>,<strong><em>canvas</em></strong>.<strong>height</strong>);

    <em>// Draw
    //gl.drawArrays(gl.POINTS, 0, 6);

    </em><strong><em>gl</em></strong>.drawArrays(<strong><em>gl</em></strong>.LINES, 0, 6);
    <em>//gl.drawArrays(gl.LINE_STRIP, 0, 6);
    //gl.drawArrays(gl.LINE_LOOP, 0, 6);
    //gl.drawArrays(gl.TRIANGLE_STRIP, 0, 6);
    //gl.drawArrays(gl.TRIANGLE_FAN, 0, 6);
    //gl.drawArrays(gl.TRIANGLES, 0, 6);

</em>&lt;/<strong>script</strong>&gt;

&lt;<strong>script</strong>&gt;
    <strong>var </strong><strong><em>thePoint </em></strong>= [25,25];
    <strong>var </strong><strong><em>rotPoint </em></strong>= <strong>new </strong>Array();
    <strong><em>rotPoint</em></strong>[0] = <strong>new </strong>Array();
    <strong><em>rotPoint</em></strong>[1] = <strong>new </strong>Array();

    <strong>var </strong><strong><em>rotatedPoint </em></strong>= <strong>new </strong>Array();
    <strong>var </strong><strong><em>alpha </em></strong>= 30 * <strong><em>Math</em></strong>.<strong>PI </strong>/ 180;

    <strong>function </strong><em>calculateVertices2D</em>(point, iterations){
        <strong>console</strong>.log(<strong>"----- Iteration " </strong>+ iterations + <strong>"------"</strong>);
        <strong>if </strong>(iterations &gt; 0) {
            <strong><em>rotPoint</em></strong>[0] = <em>rotate2D</em>(point,  <strong><em>alpha</em></strong>);
            <strong><em>rotPoint</em></strong>[1] = <em>rotate2D</em>(point, -<strong><em>alpha</em></strong>);

            <strong>console</strong>.log(<strong>"Rotated Lx: " </strong>+ <strong><em>rotPoint</em></strong>[0][0]);
            <strong>console</strong>.log(<strong>"Rotated Ly: " </strong>+ <strong><em>rotPoint</em></strong>[0][1]);
            <strong>console</strong>.log(<strong>"Rotated Rx: " </strong>+ <strong><em>rotPoint</em></strong>[1][0]);
            <strong>console</strong>.log(<strong>"Rotated Ry: " </strong>+ <strong><em>rotPoint</em></strong>[1][1]);

            <em>calculateVertices2D</em>(<strong><em>rotPoint</em></strong>[0], iterations-1)
            <em>calculateVertices2D</em>(<strong><em>rotPoint</em></strong>[1], iterations-1)
        }
            <em>//return rotPoint;
    </em>}

    <strong>function </strong><em>rotate2D</em>(point, angle){
        <strong>console</strong>.log(<strong>"in rotate2D -- x: " </strong>+ point[0] + <strong>",y: " </strong>+ point[1] + <strong>" angle: " </strong>+ angle);

        <strong><em>rotatedPoint</em></strong>[0] = 2*point[0]*<strong><em>Math</em></strong>.cos(angle)-point[1]*<strong><em>Math</em></strong>.sin(angle);
        <strong><em>rotatedPoint</em></strong>[1] = 2*point[0]*<strong><em>Math</em></strong>.sin(angle)+point[1]*<strong><em>Math</em></strong>.cos(angle);
        <strong>return </strong><strong><em>rotatedPoint</em></strong>;
    }

    <strong><em>thePoint </em></strong>= <em>calculateVertices2D</em>(<strong><em>thePoint</em></strong>, 2);

&lt;/<strong>script</strong>&gt;

&lt;/<strong>body</strong>&gt;
&lt;/<strong>html</strong>&gt;</pre><div><br></div>]]></description>
         <enclosure url="" />
         <pubDate>2018-10-31 07:16:46 UTC</pubDate>
         <guid>https://padlet.com/aldonunez319/dzp4ziqgmrxs/wish/298853763</guid>
      </item>
   </channel>
</rss>
