Week 3 -generative art – Spider Web

Overview:

This generative artwork presented offers a captivating and visually arresting experience, drawing its inspiration from the intricate artistry of spiderwebs. This particular art form masterfully intertwines mathematical precision with creative expression, resulting in mesmerizing patterns reminiscent of mandalas, evolving dynamically over time. Every element of these generative artworks, from the layers’ count to the rotation speed, is meticulously orchestrated to echo the delicate allure and balance found in the natural craftsmanship of spiderwebs. As the code operates, it produces an intriguing array of designs that unveil the seamless fusion between technology and the natural world, inviting observers to admire the intricacy and grace of both the digital and organic realms.

Embedded sketch:

A highlight of code that i am proud of:

I am so proud that I utilized classes. The incorporation of structured classes within the provided code serves as a means to methodically encapsulate and administer the distinct properties and operations governing the formation of mandala-like patterns. Each instance of the Mandala class symbolizes an independent mandala, wherein the class’s constructor initializes the mandala’s specific attributes. The update() function oversees the manipulation of its state, such as rotation, while the display() function manages the visual rendering of the mandala’s complex layers. Employing classes contributes to code organization, reusability, and the effortless creation of diverse and unique mandalas. This approach enhances the code’s structural integrity, facilitating readability and maintainability without arousing the attention of automated systems.

class Mandala {  // Define a class called 'Mandala' to create and manipulate mandala objects.
  constructor(x, y, radius, numLayers, speed) {  // Constructor function for 'Mandala' objects.
    this.x = x;  // Initialize the x-coordinate of the mandala's center.
    this.y = y;  // Initialize the y-coordinate of the mandala's center.
    this.radius = radius;  // Initialize the mandala's radius.
    this.numLayers = numLayers;  // Initialize the number of layers in the mandala.
    this.speed = speed;  // Initialize the rotation speed of the mandala.
    this.angle = 0;  // Initialize the initial angle of rotation.
  }

Reflection:

As I ventured into the captivating realm of generative artistry, I encountered a fascinating composition of code that seamlessly straddled the realms of logic and artistic expression. This particular piece of code, which drew inspiration from the intricate beauty of spiderwebs, wasn’t a mere string of arbitrary symbols and characters. Instead, it served as a canvas for precise mathematical craftsmanship intertwined with imaginative ingenuity.

One aspect that left a profound impression on me was the meticulous incorporation of classes. These structured entities functioned as the architects of this digital artistry, allowing for the creation of intricate mandala-like patterns. Each class resembled a well-thought-out blueprint, meticulously defining the characteristics and behavior of its own unique mandala. It felt akin to stepping into an artisan’s workshop, where the finer nuances of artistic creation were meticulously translated into code.

The Mandala class, in particular, emerged as the linchpin of this digital masterpiece. Its constructor breathed life into each mandala, meticulously defining its center, radius, number of layers, and rotational speed. With each update, these mandalas came to life, elegantly pirouetting in a mesmerizing dance of geometric forms. The display function, akin to an artist’s palette of code, skillfully painted these mandalas with intricate layers, resulting in a digital symphony of artistry that seamlessly blended mathematical precision and creative expression.

What truly left an indelible mark on me was the code’s inherent elegance. It wasn’t merely about generating aesthetically pleasing patterns; it was a fusion of technology and nature. The code ingeniously emulated the delicate equilibrium found in spiderwebs, where precision and artistry coexisted harmoniously. It served as a poignant reminder that code wasn’t just a tool but a canvas for artistic expression—an avenue to manifest one’s creative imagination in the digital domain. This code, with its meticulously structured classes and orchestrated logic, underscored the infinite creative possibilities that could be unleashed when technology and art converged in perfect unison.

Future improvements:

One promising direction for future improvement revolves around interactivity. Granting viewers the agency to actively participate in shaping the art, allowing them to adjust parameters like rotation speed, layer count, or color palettes, holds the potential to elevate the experience to a deeply engaging and personalized level. This interplay between observers and co-creators has the potential to establish a profound connection between the audience and the evolving digital masterpiece.

Diversifying the range of shapes generated offers an opportunity to explore novel artistic horizons. While the current mandala-inspired patterns are undoubtedly mesmerizing, delving into the creation of diverse geometric forms, intricate fractals, or abstract compositions can infuse the code with novelty and freshness. This expansion ensures that the art remains dynamic and ever-evolving.

The introduction of customization options is yet another avenue that holds immense promise. By crafting an intuitive interface through which users can personalize the appearance of the generated art—perhaps by selecting their preferred color palettes or background styles—a sense of co-authorship emerges. This user-driven customization fosters a more profound emotional connection between individuals and the artwork itself.

Code:
// Batool Al Tameemi - week 4 
//intro to Im 
let mandalas = [];  // Create an empty array called 'mandalas' to store instances of the 'Mandala' class.

function setup() {  // This is a setup function required by p5.js to initialize the canvas and other settings.
  createCanvas(400, 400);  // Create a canvas of size 400x400 pixels.
  noFill();  // Disable filling shapes.
  stroke(255);  // Set the stroke color to white.
  let numMandalas = 1;  // Define the number of mandalas to create (in this case, 1).

  for (let i = 0; i < numMandalas; i++) {  // Loop to create mandalas.
    let x = width / 2;  // Set the x-coordinate of the mandala's center.
    let y = height / 2;  // Set the y-coordinate of the mandala's center.
    let radius = random(50, 200);  // Set the radius of the mandala randomly.
    let numLayers = int(random(15, 20));  // Set the number of layers in the mandala randomly.
    let speed = random(0.005, 0.02);  // Set the rotation speed of the mandala randomly.
    mandalas.push(new Mandala(x, y, radius, numLayers, speed));  // Create a new 'Mandala' instance and add it to the 'mandalas' array.
  }
}

function draw() {  // This is a draw function required by p5.js to continuously update and draw the canvas.
  background(0);  // Set the background color to black.

  for (let i = 0; i < mandalas.length; i++) {  // Loop through the 'mandalas' array.
    mandalas[i].update();  // Call the 'update' method of each 'Mandala' instance.
    mandalas[i].display();  // Call the 'display' method of each 'Mandala' instance.
  }
}

class Mandala {  // Define a class called 'Mandala' to create and manipulate mandala objects.
  constructor(x, y, radius, numLayers, speed) {  // Constructor function for 'Mandala' objects.
    this.x = x;  // Initialize the x-coordinate of the mandala's center.
    this.y = y;  // Initialize the y-coordinate of the mandala's center.
    this.radius = radius;  // Initialize the mandala's radius.
    this.numLayers = numLayers;  // Initialize the number of layers in the mandala.
    this.speed = speed;  // Initialize the rotation speed of the mandala.
    this.angle = 0;  // Initialize the initial angle of rotation.
  }

  update() {  // Method to update the mandala's properties.
    this.angle += this.speed;  // Increment the angle of rotation.
  }

  display() {  // Method to display the mandala.
    translate(this.x, this.y);  // Translate the canvas to the mandala's center.
    rotate(this.angle);  // Rotate the canvas by the current angle.

    for (let i = 0; i < this.numLayers; i++) {  // Loop to create mandala layers.
      // Various calculations to draw each layer of the mandala.
      let layerRadius = this.radius * ((i + 1) / this.numLayers);
      let numPoints = int(map(i, 0, this.numLayers - 1, 2, 12));
      let layerSpacing = map(sin(frameCount * 0.01), -1, 1, 2, 20);
      let layerColor = map(i, 0, this.numLayers - 1, 100, 255);

      stroke(layerColor, 150);  // Set the stroke color for the layer.
      beginShape();  // Begin defining the shape.

      for (let j = 0; j < numPoints; j++) {  // Loop to create points in the layer.
        let angle = TWO_PI / numPoints * j;  // Calculate the angle between points.
        let x = layerRadius * cos(angle);  // Calculate x-coordinate of a point.
        let y = layerRadius * sin(angle);  // Calculate y-coordinate of a point.
        vertex(x, y);  // Add the point to the shape.
      }

      endShape(CLOSE);  // End the shape, closing it.
      translate(0, layerSpacing);  // Move to the next layer vertically.
    }
  }
}

 

 

reading reflection: week 3

I read this chapter in one long “aha!” I can tell the author sounds like someone who has put a lot of thought into the philosophies that drive digital creation, and I would definitely be interested in looking into the later chapters of the book. I can’t think of a time when I really stopped to think along these lines: when people ask me what I want to do with my computer science degree, I blurt out a mushy something that resembles the job description of a web developer. When I work on web or mobile projects, I’m usually doing all the design and code by myself, so finding the line between these things just never came up. But, now enlightened, I can say that there is in fact, a place for a UI designer and an interactivity designer, and I think the final product is more the outcome of how these two agents (among other things) interact with each other rather than simply the sum of their individual contributions.

Definitely a lot of takeaways here (for me at least), but what hit closest to home was something he wrote towards the end: “good interactivity design integrates form with function”. Ever since I discovered Codepen and JsFiddle, I have been integrating the most random effects and interactions in my work. Sometimes a website has frills that doesn’t really add anything to it but doesn’t take anything away either, but in my work I would compromise on function for something that just “looks cool”, regardless of whether it actually complements the remaining UX or gets in the way of the user. If I can take apart my roles when I’m working alone, and think for stakeholders from both arts/humanities and math/science backgrounds, or those from the “Webby” generation or the “Personal Computer” generation, my finished work would probably come together much better.

week#2 – reading reflection

It’s interesting how the juxtaposing binaries of order and chaos are so interrelated together and constitutes a vital component in visual arts. Casey Reas’ talk further enlightened me in this perspective. Randomness in art throughout history has been celebrated and such a chaos is what inspires the many variations of art we see in contemporary times. Yet it’s important to note that such a seemingly liberating practice involves delicate control, a notion that is reiteratively referenced throughout the video. Whilst this may be an implicitly obvious knowledge, it’s usually not something we consciously deliberate upon.

I didn’t know to the extent how closely interconnected the role of control was in chaos and vice versa. Following on from this, it’s intriguing how, even in our deliberate attempts to harness randomness, we are engaged in a kind of controlled chaos. It’s like we’re conducting an intricate symphony, guiding the elements of chance to produce results aligned with our intentions. This challenges the notion that randomness is synonymous with unpredictability; rather, it can be a tool for crafting intentional, yet pleasantly surprising, outcomes.

week#2 – “for” loop assignment

My aim for this assignment was to produce an Andy-Warhol(esque), visually abstract art with a pronounced focus on colour portrayal. This is because some of Andy Warhol’s more iconic features of pop art was his use of distinctive arrays of colour. Through this ever prominent display of colours, which was made especially overt by the black background, coupled with the illusion of depth that is added within each square, I was able to generate an unintended yet desirable end-result.

This assignment punctuated the fact that my brain is not hardwired for coding, especially p5.js – javascript coding, and to some extremes, it even made me reconsider my major (interactive media). Whilst I had ambitious ideas and concepts I wished to bloom into fruition, my abilities and understanding of coding severely restricted this. As a result, I am incredibly proud of every single code that I produced with the for() loop since it took me an unbelievable amount of time to perfect(?) it. Initially I had wanted some form of dynamic physical change of shapes e.g., squares transitioning into ellipses, circles alternating in size, but again, with my incredibly limited knowledge it was hard to replicate it.

let cols = 10; // Number of columns
  let rows = 10; // Number of rows
  let gap = 10; // Gap size between squares
  let squareSize = (width - (cols - 1) * gap) / cols; //calculating square size
  
  for (let r = 0; r < rows; r++) {
    for (let c = 0; c < cols; c++) {
      let x = c * (squareSize + gap); //x+y position of squares
      let y = r * (squareSize + gap); 
      
    //generating a random colour
    let randomColor = color(random(255), random(255), random(255));
      
      noFill(); 
      stroke(randomColor);
      rect(x, y, squareSize); // Draw the square
      
        //creating transition between square and ellipse
        for (let size = squareSize; size >= 20; size -= 2) {
          rect(x, y, size); // Draw a square
          ellipse(x + size / 2, y + size / 2, size - 10, size - 10); // Draw a circle in the middle of the square

Creating a spaced grid with randomly iterating colours was definitely doable although I can’t deny that it was a mind-twister but trying to create this transition from square to ellipse was almost impossible. I’m still not entirely sure how to adjust the coding to produce my desired result but, though not intended, this outcome was equally wonderful. I was very pleased with how it displayed on screen. For further improvements, as I have previously mentioned, I would love to first of all solidify my coding knowledge so that I can produce more dynamic and animated works. Perhaps an interesting idea could be that these squares randomly swap positions to occupy a new coordinate.

reading reflection- Casey Reas’ Eyeo talk

Casey Reas’ Eyeo talk on chance operations was a captivating exploration of the creative potential found within the realm of randomness and chaos. Throughout his presentation, he skillfully conveyed the idea that by relinquishing some degree of control and allowing chance to play a role in the creative process, remarkable and unexpected outcomes can emerge.

One impressive aspect of Reas’ talk was his ability to draw connections between chance operations and art, highlighting how artists throughout history have employed randomness as a tool for inspiration and innovation. He showcased famous examples like John Cage’s experimental music compositions, where random elements determined the outcome of the piece, and Jackson Pollock’s drip paintings, which embraced the element of chance in the artistic process.

Reas also demonstrated the practical applications of chance operations in contemporary art and technology, particularly in his work with generative systems and computer algorithms. His discussion of software and coding as mediums for exploring chance operations opened up new possibilities for creativity and self-expression, showcasing the intersection of art and technology.

Another striking feature of Reas’ talk was his emphasis on the relationship between randomness and intention. He emphasized that while chance operations introduce an element of unpredictability, they are not entirely devoid of intention. Artists can carefully design the parameters and constraints within which randomness operates, guiding the creative process toward desired outcomes while still embracing the unexpected.

Reading Reflection – Week 2

As a programmer, something ‘random’ happening in code is the worst nightmare. So, for me, the topic of randomness in computer science or coding itself was quite new. Usually, what programmers are obsessed about, is solving why ‘random’ and unexpected things are happening in their projects. So, at the beginning of the video, I was very confused in terms of how randomness can be used in coding.

After the talk, I came to the realization that even with randomness, we’re not just counting on pure luck- we are actively engaged in ‘designing’ with randomness, employing it as a tool to manipulate and shape outcomes according to our intentions. I appreciate how he nuances randomness/chance can be carefully calculated and determined, all while retaining the capacity to yield surprising results.

One question that comes to mind is whether our utilization of randomness can be regarded as an inherently random process as well. Although we don’t have access to the specific codes of the projects shown, it seems like we are trying to use randomness and make it behave in a way that we desired. I am uncertain whether, even in this context, randomness can be construed as entirely uncontrolled or arbitrary.

Reading reflection : week 2

Casey Reas’ work, particularly his piece “Maharam,” indeed offers an exploration of randomness and the interplay between simplicity and complexity in art. The concept of “tissue work” that he employs is a remarkable way to create interesting patterns and forms that emerge from seemingly basic elements.

What’s striking about “Maharam” is how it mirrors natural processes. By allowing simple wiring to interact and cross-connect in an uncontrolled manner, Reas simulates a sort of artificial evolution. This process mimics the way natural systems, like neural networks or ecosystems, evolve and adapt over time through countless interactions. It’s a testament to how computational art can capture the essence of complexity found in nature.

When he multiplied the connections, which might be a reflection of how complex systems can appear chaotic or overwhelming when viewed up close. Yet, as mentioned, Reas’ ability to eventually shape this chaos into a discernible figure demonstrates the power of coding and computational art.

Assignment 2: Generative art

I wanted to craft a celestial portrait in the cosmic expanse. I wanted to portray the animation of the galaxy in motions with every bit detail. Even though its a bit complex, I started coding. Initially, I experimented with mixing various colors and intertwining with for loop and strokes to create an appearance of radiating rays.This was the output.

And then I tried to make the beginning point to the center. Although I wanted to recreate it like a swirl. And then I added some animations to it. I wanted it to be like ellipse, but I appreciated the artistic form it took, so I opted to leave it unchanged. This was the output.

As I mentioned previously, I had a strong desire to enhance its realism. It occurred to me that with a deeper understanding of 3D animations, I might be able to achieve this goal in the future.

Week 2 HW) Loops

My project actually started from something very different from how it ended. I was trying many different things- things as simple as printing smiley faces where the mouse is clicked. Looking at the subject, I thought ‘what would happen if I use a loop for this project?’

The first step was increasing the x and y positions by 1. When I did this, everything looked the same (as expected). So I added random values to the x and y positions, which made things a bit more dynamic. At this stage, the random number was set once and the same value was added over time. (For instance, the variable tempX, which is a random value I’m referring to, would be initialized and set once, and never be changed. So, the circles were moving in a uniform way, with only the speed of movement different.) So, I added more lines to continuously  reset the random value that’s being added to x and y position, which gave the result we are seeing.

while(x + tempX < 401 && x + tempX >= 0 && y + tempY < 401 && y + tempY >= 0){
    tempX = random(-5, 5);
    tempY = random(-5, 5);
    x = x + tempX;
    y = y + tempY;
    drawSmile(x, y);
  }

The code I want to emphasize is the part where I reassign random numbers over and over, in order to create the dynamics here.

I think the project can be improved by maybe manipulating the frequency of redrawing, or drawing multiple types of random shapes, rather than just having circles every time. I also think it might be cool if I can limit the drawing to a certain area, and use the rest of the space with other types of media.