I want to change the shape of circle into triangle,,
Is there any way to change it..?
**if it is impossible to change with triangle, it would be ok with square or polygon, etc..
let button;
let particles;
function setup() {
createCanvas(200, 200, WEBGL);
button = createButton('Reset');
button.mousePressed(resetModel);
resetModel();
function draw() {
background(50);
orbitControl();
lights();
noStroke();
model(particles);
}
function resetModel() {
if (particles) {
freeGeometry(particles);
}
particles = buildGeometry(createParticles);
}
function createParticles() {
for (let i = 0; i < 60; i += 1) {
let x = randomGaussian(30, 20);
let y = randomGaussian(0, 20);
let z = randomGaussian(0, 20);
push();
translate(x, y, z);
sphere(5);
pop();
}
}
enter image description here
New contributor
유예리 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.