Aitor Aurean Clock V2.0
CÓDIGO
//(C)Sergio Salazar Latorre
//Aitor Aurean Clock V2.0
let l=600
let epl=3
let np = epl*epl
let p=Array(np)
let DD=l/epl
let rr=DD/2
function setup() {
createCanvas(l,l);
aac= new AAC()
aac.crearAN()
}
function draw() {
background(0,15);
fill(255)
noStroke()
aac.dibujarAN()
firma()
}
//--------------
class AAC{
constructor(){
this.a=0//angulo
this.r=1//radio
this.cx
this.cy
this.cF
this.CS
this.eD
this.v = 0.02
this.m2
this.m3
this.m5
this.m8
this.m13
this.m21
}
crearAN(){
this.m12 = new AureanNumber(l*5/8, l*5/8, 0, 0.002, 20, 6, 255,255,0.5,0.5,1)
this.m13 = new AureanNumber(l*5/8, l*5/8, 0, 0.003, 30, 9, 255,255,0.5,0.5,1)
this.m15 = new AureanNumber(l*5/8, l*5/8, 0, 0.005, 50, 15, 255,255,0.5,0.5,1)
this.m18 = new AureanNumber(l*5/8, l*5/8, 0, 0.008, 80, 24, 255,255,0.5,0.5,1)
this.m113 = new AureanNumber(l*5/8, l*5/8, 0, 0.013, 130, 39, 255,255,0.5,0.5,1)
//m21 = new AureanNumber(l*5/8, l*5/8, 0, 0.21, 210, 69, 255,255)
this.m22 = new AureanNumber(l*3/8, l*3/8, 0, 0.002, 20, 6, 255,255,1,1,-1)
this.m23 = new AureanNumber(l*3/8, l*3/8, 0, 0.003, 30, 9, 255,255,1,1,-1)
this.m25 = new AureanNumber(l*3/8, l*3/8, 0, 0.005, 50, 15, 255,255,1,1,-1)
this.m28 = new AureanNumber(l*3/8, l*3/8, 0, 0.008, 80, 24, 255,255,1,1,-1)
this.m213 = new AureanNumber(l*3/8, l*3/8, 0, 0.013, 130, 39, 255,255,1,1,-1)
}
dibujarAN(){
this.m12.ponerManecilla()
this.m13.ponerManecilla()
this.m15.ponerManecilla()
this.m18.ponerManecilla()
this.m113.ponerManecilla()
//m21.ponerManecilla()
this.m22.ponerManecilla()
this.m23.ponerManecilla()
this.m25.ponerManecilla()
this.m28.ponerManecilla()
this.m213.ponerManecilla()
rectMode(CENTER)
this.interLines()
this.otherLines()
}
otherLines(){
push()
stroke(255,255,0)
noFill()
beginShape()
vertex(this.m12.x,this.m12.y)
vertex(this.m13.x,this.m13.y)
vertex(this.m15.x,this.m15.y)
vertex(this.m18.x,this.m18.y)
vertex(this.m113.x,this.m113.y)
endShape()
pop()
stroke(0,255,255)
noFill()
beginShape()
vertex(this.m22.x,this.m22.y)
vertex(this.m23.x,this.m23.y)
vertex(this.m25.x,this.m25.y)
vertex(this.m28.x,this.m28.y)
vertex(this.m213.x,this.m213.y)
endShape()
}
interLines(){
push()
stroke(255,0,0)
beginShape()
vertex(this.m12.x,this.m12.y)
vertex(this.m22.x,this.m22.y)
endShape(CLOSE)
beginShape()
vertex(this.m13.x,this.m13.y)
vertex(this.m23.x,this.m23.y)
endShape(CLOSE)
beginShape()
vertex(this.m15.x,this.m15.y)
vertex(this.m25.x,this.m25.y)
endShape(CLOSE)
beginShape()
vertex(this.m18.x,this.m18.y)
vertex(this.m28.x,this.m28.y)
endShape(CLOSE)
beginShape()
vertex(this.m113.x,this.m113.y)
vertex(this.m213.x,this.m213.y)
endShape(CLOSE)
pop()
}
}
class AureanNumber
{
constructor(cx, cy, a, v, r, eD, cF, cS,rx,ry,s){
this.x
this.y
//this.cx = cx
//this.cy = cy
this.cx=l/2
this.cy=l/2
this.a = a
this.r = r
this.eD = eD
this.v=v
this.rx=rx
this.ry=ry
this.s=s
}
dameX(){
return this.x
}
dameY(){
return this.y
}
ponerManecilla(){
this.x = l/2 + this.s*cos(this.a)*this.r*this.rx*2
this.y = l/2 + sin(this.a)*this.r*this.ry*2
fill(255)
stroke(255)
//circle(this.x, this.y, this.eD)
square(this.x,this.y,2)
this.a += this.v
}
}
function firma(){
push()
fill(255,0,0)
strokeWeight(3)
stroke(255)
text("Aitor Aurean Clock V2.0", 10, l-9*2)
text("(C)Sergio Salazar Latorre", 10, l-5)
pop()
}
Comentarios
Publicar un comentario