<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Priya Rathod on Medium]]></title>
        <description><![CDATA[Stories by Priya Rathod on Medium]]></description>
        <link>https://medium.com/@prriiiyya?source=rss-fbe77850b18c------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*qYdFiZ8NkmHkBlbYNaSDXw.jpeg</url>
            <title>Stories by Priya Rathod on Medium</title>
            <link>https://medium.com/@prriiiyya?source=rss-fbe77850b18c------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sat, 21 Nov 2026 09:57:00 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@prriiiyya/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Intersection of Art and Technology with p5.js]]></title>
            <link>https://medium.com/@prriiiyya/intersection-of-art-and-technology-with-p5-js-7c1d8025e17f?source=rss-fbe77850b18c------2</link>
            <guid isPermaLink="false">https://medium.com/p/7c1d8025e17f</guid>
            <category><![CDATA[datavisualizationservices]]></category>
            <category><![CDATA[interactive-content]]></category>
            <category><![CDATA[p5js]]></category>
            <dc:creator><![CDATA[Priya Rathod]]></dc:creator>
            <pubDate>Mon, 10 Jun 2024 17:09:40 GMT</pubDate>
            <atom:updated>2024-06-10T17:09:40.788Z</atom:updated>
            <content:encoded><![CDATA[<p>4 composition codes snippets that will make you adore p5.js</p><h3>Why Creative Coding?</h3><p>Creative coding is a unique field that combines art and technology, allowing us to create visually stunning and interactive graphics using programming languages. For someone with a foundation in Computer Science, creative coding offers a chance to apply technical skills in a more artistic and expressive way.</p><h3>What to Expect from This Article</h3><p>In this article, I’ll take you through my journey with creative coding by sharing code snippets for some of the creations and recreations I made during the course, inspired by artists like Bruno Munari and Vera Molnar, and mathematicians like Sébastien Truchet. Whether you’re a seasoned coder or just curious about creative coding, I hope you’ll find something inspiring here.</p><p>Here’s a small showreel of the compositions:</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fplayer.vimeo.com%2Fvideo%2F956019595%3Fapp_id%3D122963&amp;dntp=1&amp;display_name=Vimeo&amp;url=https%3A%2F%2Fvimeo.com%2F956019595&amp;image=https%3A%2F%2Fi.vimeocdn.com%2Fvideo%2F1867603948-5847d4d5eb1cd39b3b75c7eae0bd5af42eb27853c312d5d4ad478d126942a68b-d_960&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=vimeo" width="1200" height="626" frameborder="0" scrolling="no"><a href="https://medium.com/media/2befc1da667bbf8e0fa970b65111cb31/href">https://medium.com/media/2befc1da667bbf8e0fa970b65111cb31/href</a></iframe><p>Here are some code snippets for few of my favorite projects.</p><h3>1. Quatre éléments distribués au hasard by Vera Molnár</h3><p>Vera Molnar is a pioneering figure in the field of digital art, known for her algorithmic approach to creating abstract art. Her work often involves simple geometric shapes and lines, arranged in seemingly random yet meticulously calculated patterns. One of her notable pieces is “Quatre éléments distribués au hasard,” which translates to “Four Elements Distributed Randomly.” This piece exemplifies her method of using randomization within a structured grid to create visually engaging compositions.</p><p>Inspired by Molnar’s approach, I recreated “Quatre éléments distribués au hasard” using p5.js. Here’s the code:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/500/1*1OP3QgeYNNehYuGf6vGWOg.jpeg" /></figure><pre>// Quatre éléments distribués au hasard,<br><br>//CODE<br><br>let nb = 10;<br>let dimension = 0;<br>let margin = 40;<br>let x,y;<br><br>function setup() {<br>createCanvas(500, 500);<br>dim = (width-2*margin)/nb;<br>noLoop();<br>}<br><br>function draw() {<br>background(255);<br><br>for(let j=0; j&lt;nb; j=j+1)<br>{<br>for(let i=0; i&lt;nb; i=i+1)<br>{<br>x = margin + i*dim;<br>y = margin + j*dim;<br>      noFill();<br>      //stroke(220);<br>     // rect(x,y,dim,dim);<br>      stroke(0);<br>      strokeWeight(4);<br><br>      let r = int(random(0,4));<br><br>      if(r == 0)<br>        {<br>        line(x,y,x+dim,y+dim);<br>        }<br><br>      else if(r == 1)<br>        {<br>         line(x,y+dim,x+dim,y);<br>        }<br><br>      else if(r == 2)<br>        {<br>         line(x+dim/2,y,x+dim/2,y+dim);<br>        }<br><br>      else<br>        {<br>         line(x,y+dim/2,x+dim,y+dim/2);<br>        }<br>    }<br>}<br><br>function keyPressed()<br>{<br>  redraw();<br>}</pre><h3>2. Faces by Bruno Munari</h3><p>Munari, a master of experimental art and design, is celebrated for his groundbreaking contributions to visual communication. One of his notable works is “Faces,” a series of abstract compositions that explore the essence of facial expressions through geometric forms and playful arrangements.</p><p>Inspired by Munari’s innovative approach, I embarked on recreating “Faces” using p5.js. Here’s a glimpse of the code:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/496/1*puB2nqXPr2fu1Jubk6rRBQ.png" /></figure><pre>function setup() {<br>  createCanvas(600, 600);<br>}<br><br>function draw() {<br>  background(255);<br>  <br>  //mail circle<br>  circle(300,300,500);<br>  strokeWeight(2);<br>  <br>  //nose lines<br>  line(250,54,250,546);<br>  line(350,54,350,546);<br>  strokeWeight(1);<br>  noFill()<br>  <br>  //eyes<br>  strokeWeight(2);<br>  circle(154,250,190);<br>  strokeWeight(1);<br>  circle(445,250,190);<br>  circle(154,250,170);<br>  circle(445,250,170);<br>  circle(154,250,100);<br>  circle(445,250,100);<br>  strokeWeight(2);<br>  circle(154,250,20);<br>  circle(445,250,20);<br>  <br>  //mouth<br>  strokeWeight(2);<br>  circle(300,390,100);<br>  strokeWeight(1);<br>  circle(300,390,40);<br>  <br>  //nostrils<br>  <br>  fill(&#39;black&#39;);<br>  circle(260,337,10);<br>  <br>  fill(&#39;black&#39;);<br>  circle(340,337,10);<br>  <br>  <br>  <br>  noFill();<br>  strokeWeight(2);<br>   img.save(&#39;BrunoMunari1&#39;, &#39;png&#39;);<br>  <br>}<br></pre><h3>3. Flow Fields</h3><p>Using some mathematical functions let’s create something ‘natural’ this time.</p><p><strong>Perlin Noise</strong>, a revolutionary algorithm by Ken Perlin, adds fluidity and coherence to digital art. With its smooth transitions, it’s perfect for simulating natural patterns and textures in creative coding projects.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/499/1*uh92g-xndz3z8uEfnlCrxQ.png" /></figure><pre>//flow field<br>//Perlin Noise function<br><br>let nb = 1000;<br>let dMin = 50;<br>let noiseScale = 0.005;<br>let noiseAngle = 360;<br>let noiseSpeed = 1;<br>let ageMax = 1000;<br>let p = Array(400);<br><br>function setup() {<br>  createCanvas(windowWidth, windowWidth);<br>  angleMode(DEGREES);<br>  background(0);<br>  for(let i=0; i&lt;nb; i=i+1)<br>    {<br>      p[i]=new Particle(random(0,width),random(0,height));<br>    }<br>}<br><br>function draw() {<br> <br> // noStroke();<br>  //fill(255);<br>  stroke(255, map(frameCount,1,ageMax,255,0));<br>  for(let i=0;i&lt;nb;i=i+1)<br>    {<br>       p[i].draw();<br>    }<br>  <br>    <br>}<br><br>class Particle<br>  {<br>    constructor(x,y)<br>    {<br>      this.x = x;<br>      this.y = y;<br>      this.vx = random(-2,2);<br>      this.vy = random(-2,2);<br>    }<br>    <br>    draw()<br>    {<br>      let n = noiseAngle*noise(noiseScale*this.x,noiseScale*this.y);<br>      this.vx = noiseSpeed * cos(n);<br>      this.vy = noiseSpeed * sin(n);<br>      <br>      this.x = this.x + this.vx;<br>      this.y = this.y + this.vy;<br>      <br>      if(this.x&lt;0 || this.x&gt;width ||this.y&lt;0 || this.y&gt;height)<br>        {<br>          this.x=random(0,width);<br>          this.y=random(0,height);<br>        }<br>      //circle(this.x,this.y,5);<br>      point(this.x,this.y);<br>    }<br>  }</pre><h3>3. Manipulating Google fonts with p5.js</h3><p>Last but not the least, with p5.js’s dynamic capabilities, you can transform text into vibrant visuals, opening up a world of creative possibilities.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*s3i0e6edHm4TovkZxJ2cfQ.png" /></figure><pre>let font;<br>let points;<br>let txt=&quot;CODE&quot;;<br>let xTxt=0, yTxt=250;<br>let fontSize=300;<br>let drawMode=1;<br><br>function preload()<br>{<br>  font=loadFont(&quot;NunitoSans-VariableFont.ttf&quot;);<br>}<br>function setup() {<br>  createCanvas(windowWidth, windowHeight);<br>  angleMode(DEGREES);<br>  xTxt=width/2;<br>  yTxt=height/2;<br>  <br>  <br> <br>}<br><br>function draw() {<br>  computePoint(map(mouseX,0,width,0.005,0.1));<br>  background(0);<br>  stroke(255);<br>  beginShape();<br>  for(let i=0;i&lt;points.length;i=i+1)<br>    {<br>      vertex(points[i].x,points[i].y);<br>    }<br>  endShape();<br>  fill(0);<br>  strokeWeight(2);<br>  <br>  for(let i=0; i&lt;points.length; i=i+1)<br>    {<br>      phase=dist(mouseX,mouseY,points[i].x,points[i].y);<br>      d=sin(frameCount );<br>      circle(points[i].x,points[i].y,100*d);<br>    }<br>}<br><br>function computePoint(factor)<br>{<br>   points = font.textToPoints(txt,xTxt,yTxt,fontSize,{sampleFactor : factor});<br>  <br>  let bounds = font.textBounds(txt,xTxt,yTxt,fontSize);<br>  <br>  for(let i=0;i&lt;points.length;i++)<br>    {<br>      let p = points[i];<br>      p.x=p.x-bounds.w/2;<br>       p.y=p.y-bounds.h/2;<br>      <br>    }<br>}</pre><h3>Finally,</h3><p>Thank you for joining me on this journey. I look forward to sharing more of my projects and experiences in the future. Stay tuned!</p><p>#LifelongLearning #CreativeCoding #Domestika #GraphicDesign #TechAndArt #ProfessionalGrowth #p5js #ComputerScience #DigitalArt #GameDevelopment #DataViz #InteractiveDesign</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=7c1d8025e17f" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>