To Do This Week
Work on World-Building Online Exhibition
Read:
Blog Prompt: Read the article by Amy Goodchild and discuss some of the techniques that interests you. In class we will play with both generative visual art as well as generative literature or language art. Both require the use of JavaScript.
Class
Programming Concepts>Javascript Syntax
statements
variables
data types: strings, numbers, booleans, arrays
basic operators and “shortcut” operators
comparison operators
arrays
adding javascript to a page (internal and external methods)
javascript commenting
objects / methods / properties
functions
for loops
conditional statements
scope
GENERATIVE Art
Generative visual art is a type of digital art made using computer algorithms. Artists use programming tools like Processing or its JavaScript version P5js to set rules. The computer then creates art by following these rules, leading to unique and sometimes changing images or animations. The artist decides the starting point, but the computer’s actions create the final piece. This art can include anything from simple designs to complex, moving visuals. It’s a way for artists to blend coding with art, creating new and unexpected visual works.
GENERATIVE ART: Art created using autonomous processes
AUTONOMOUS PROCESS: A process not under direct human control
- randomness / pseudorandomness
- rules, instructions, algorithms, math
- natural systems
-Amy Goodchild’
The random() function in p5.js generates pseudorandom numbers. It can return a floating-point number between 0 and 1, a number within a specified range, or a random element from an array, depending on how it’s used. It’s useful for introducing unpredictability and variation in sketches.
The noise() function in p5.js generates Perlin noise, which produces smooth, natural-looking sequences of numbers. Unlike random numbers that jump abruptly, values from noise() change gradually and predictably, making them ideal for creating organic patterns, textures, and motions in generative art and animations.
John Conway’s Game of Life (P5js simultaion)
Vera Molnar
Generative Art In-class Exercise
Examples:
- JavaScript Functions > Make a change
- JavaScript Functions > Select from Arrays
- JavaScript Canvas Drawing + Animation
- JavaScript Canvas with Processing (P5js)
- JavaScript Canvas with Processing (P5js) – Perlin Noise
- ZIP of all JavaScript files
Flow Fields:
Creating a flow field with p5.js involves simulating a fluid-like motion by placing particles in an invisible vector field, where each vector influences the direction and speed of the particles moving over it. Below is a simple example of a flow field in p5.js embedded in a one-page HTML5 document. This example uses Perlin noise to generate the vector directions for a more organic flow.
JavaScript Canvas with Processing (P5js) -Flow Fields
Description by Tyler Hobbs
Procesessing for JavaScript
draw(): executes the code contained within its block repeatedly, allowing for the animation and interaction within the canvas. It’s where most of the dynamic drawing code goes.
fill(): Sets the color used to fill shapes.
arc(): Draws an arc or a portion of an ellipse.
P5js : arc(x, y, w, h, start, stop, [mode], [detail]);
HTML5 Canvas: arc(x, y, radius, startAngle, endAngle, anticlockwise)
Assignment 1: Interactive HTML5 Work
Create a webpage that changes when the user clicks a button or presses a key.
- Discuss with ChatGPT to decide on the interaction (e.g., change color, show text).
- Describe in a prompt what you want for a one-page HTML5 page with JavaScript for your idea.Ask for comments in the source code to help you learn
- Copy code and paste into a text-editor
- Experiment with different events, values and effects.
- Upload and post to blog
Assignment 2: Generative Art with P5.js
Use P5.js to create a design that randomly generates shapes or patterns.
- Brainstorm ideas, in a Chat, for designs with P5js and random behavior
- Describe in a prompt what you want for a one-page HTML5 page with JavaScript for your idea. Ask for comments in the source code to help you learn]
- Copy code and paste into a text-editor
- Adjust parameters to refine the design.
- Upload and post to blog
Assignment 3: Generative Animation with P5.js
Create an animation in P5.js where elements move or change over time
- Brainstorm ideas, in a Chat, for designs with P5js and random behavior.
- Conceptualize the animation, planning movement and interactions.
- Describe in a prompt what you want for a one-page HTML5 page with JavaScript for your idea. Ask for comments in the source code to help you learn
- Copy code and paste into a text-editor
- Experiment with movement parameters and interactions.
- Upload and post to blog
GENERATIVE LITERATURE
Generative language art refers to a type of electronic literature or “e-lit” that uses a computer script or algorithm. The computer generates the artwork, poem or story based on parameters set by the artist/writer or through self-generating processes. The output can be a unique, often random and evolving, digital work.
JavaScript and Poetic Text
Taroko Gorge , by Nick Monfort
taroko script with comments
Taper: an online literary magazine for small computational pieces.
All code (in the form of ES6, CSS, and HTML) must be placed between the template’s closing header tag (</header>) and the closing body tag (</body>), must be valid HTML5, and must fit within 2KB (2048 bytes)
- https://taper.badquar.to/2/if_jupiter_had_turned_into_a_star.html
- https://taper.badquar.to/4/links.html
- https://taper.badquar.to/6/chance_infections.html
- https://taper.badquar.to/7/night_voyagers.html
- https://taper.badquar.to/7/moons_of_jupiter_7.html
- https://taper.badquar.to/7/verdigris_7.html
- https://taper.badquar.to/11/returning_thoughts.html
- https://taper.badquar.to/11/hollywood_hitmaker.html
- https://taper.badquar.to/11/hail.html
- https://taper.badquar.to/7/flaneur_treadmill.html
Interactive Multimodal Game Development (15%)
DUE April 5