Antenna Generator

Size
2,624 Kb
Views
40,480

How do I make an antenna generator?

Click to generate a new pattern!I was googling fractal trees and random walks and stumbled upon this image that inspired me to make this Pen.. What is a antenna generator? How do you make a antenna generator? This script and codes were developed by Johan Karlsson on 10 September 2022, Saturday.

Antenna Generator Previews

Antenna Generator - Script Codes HTML Codes

<!DOCTYPE html>
<html >
<head> <meta charset="UTF-8"> <title>Antenna Generator</title> <link rel="stylesheet" href="css/style.css">
</head>
<body> <script src='https://cdnjs.cloudflare.com/ajax/libs/p5.js/0.5.6/p5.min.js'></script> <script src="js/index.js"></script>
</body>
</html>

Antenna Generator - Script Codes CSS Codes

html, body { margin: 0;
}
canvas { display: block;
}

Antenna Generator - Script Codes JS Codes

"use strict";
var steps;
function setup() { createCanvas(windowWidth, windowHeight); cursor(HAND); reset();
}
function draw() { background("white"); noLoop(); var l = min(windowWidth, windowHeight); drawLines(windowWidth / 2 - l / 2, windowHeight / 2, l, 0, steps);
}
function windowResized() { resizeCanvas(windowWidth, windowHeight);
}
function mouseClicked() { reset(); draw();
}
function reset() { steps = round(random(3, 6));
}
function drawLines(x, y, length, angle, level) { if (level === 0) { return; } push(); translate(x, y); rotate(angle); line(0, 0, length, 0); var nrOfParams = round(random(4, 7)); for (var i = 0; i < nrOfParams; i++) { var angle = random([-PI / 2, PI / 2]); var position = random(); var sizeFactor = random(0.2, 0.6); drawLines(length * position, 0, length * sizeFactor, angle, level - 1); } pop();
}
Antenna Generator - Script Codes
Antenna Generator - Script Codes
Home Page Home
Developer Johan Karlsson
Username DonKarlssonSan
Uploaded September 10, 2022
Rating 3.5
Size 2,624 Kb
Views 40,480
Do you need developer help for Antenna Generator?

Find the perfect freelance services for your business! Fiverr's mission is to change how the world works together. Fiverr connects businesses with freelancers offering digital services in 500+ categories. Find Developer!

Johan Karlsson (DonKarlssonSan) Script Codes
Create amazing web content with AI!

Jasper is the AI Content Generator that helps you and your team break through creative blocks to create amazing, original content 10X faster. Discover all the ways the Jasper AI Content Platform can help streamline your creative workflows. Start For Free!