xxxxxxxxxx
54
// firstly describe how to define a class
//then create an array to create any number of objects
let icomod = [];
let topPent = [];
var a, b, c;
var x = 0;
var xpos2 = 400.2;
var ypos2 = 6.7;
var xdirection2 = 1; // Left or Right
var ydirection2 = 1; // Top to Bottom
var xspeed2 = 0.2; // Speed of the shape
var yspeed2 = 0.2; // Speed of the shape
function preload() {
raleway = loadFont('data/Raleway-Medium.ttf');
}
function setup()
{
createCanvas(400, 400, WEBGL);
for (let i = 0; i < 20; i++)//iterates numbers of objects
{
//IcoModo(angle, radius, xspeed2, yspeed2, zdepth)
let x = 20 + 10 * i;//increment value
let r = 20 + 10 * i;//increment value
icomod [i] = new IcoModo(x, r, 10, 2.1, 100);
}
}
function draw()
{
background(0);
textSize(32);
textFont(raleway)
//text('word', 10, 30);
text("hidden forest p2 " + xpos2, -200, xpos2/2);
//console.log(x);//prints to console
//let v1 = createVector(1, 2, 3);
//let v2 = v1.copy();
//print(v1.x === v2.x && v1.y === v2.y && v1.z === v2.z);
//lighting
//spotLight(3, 10, 126, 80, 20, 40, -1, 0, 0, PI/2, 2);
for (let i = 0; i < icomod.length; i++)//iterates numbers of objects or lenght of array
{
icomod[i].create(i);
icomod[i].init(i);
}
//icomod5.spotlite();
}