Mini Project 4. Purple Haze

Project Title: Purple Haze

Link:https://editor.p5js.org/N-A-E-S/sketches/9AoAeKusd

Brief Description: This project aims to create a self-generative smoke-like atmosphere for project A. The project used Perlin Noise to generate continuous random values to denote the different parts of the smoke area.

Visual Documentation: Purple Haze under different frames

Coding:

function setup() {
createCanvas(600, 600)
noStroke()
}

function draw() {
const noiseScale = 0.01
bscale=map(sin(frameCount*0.05),-1,1,5,10)
for (let i = 0; i < width; i += bscale) {
for (let j = 0; j < height; j += bscale) {
const noiseVal = noise(i * noiseScale, j * noiseScale,frameCount*0.05)
const currentColor = map(noiseVal, 0, 1, 0, 255)
fill(currentColor*0.75+map(sin(frameCount*0.05),-1,1,20,50),50,map(sin(frameCount*0.05),-1,1,120,170))
rect(i,j,bscale,bscale)
}
}
}

 

Leave a Reply

Your email address will not be published. Required fields are marked *