Air Island 3D
Para navegar por la “Air Island” presionar en la imagen:
Pellizcar diagonal - Zoom
Arrastrar dos dedos - Desplazar
Arrastrar un dedo - Giro
For swim in this world press at image:
Diagonal Pinch - Zoom
Drag two fingers - Scroll
Drag one finger - Turn
CÓDIGO
//(C)Sergio Salazar Latorre
// Air Island 3D
let l=1000
let szMax = 100
let np = 500
let p = Array(np)
//-------------------
function configSetup(){
createCanvas(l,l, WEBGL);
angleMode(DEGREES)
}
function configDraw(){
orbitControl()
background(0);
strokeWeight(0.1)
stroke(0)
}
function Firma(){
push()
fill(0)
strokeWeight(4)
stroke(0)
text("(C)Sergio Salazar Latorre", 10, l-20)
text("Air Island 3D V.1.0",10,l-9)
strokeWeight(0.1)
pop()
}
function cargarParticulas(){
for(let i=0; i<np; i++){
p[i] = new Fig3D()
}
}
function verParticulas(){
for(let i=0; i<np; i++){
p[i].caja()
}
}
//-------------------
function setup() {
configSetup()
cargarParticulas()
}
function draw() {
configDraw()
verParticulas()
}
//....................
class Fig3D{
constructor(){
this.x = random(-l/2,l/2)
this.y = random(-l/2,l/2)
this.z = random(-l/2,l/2)
this.ww = random(szMax)
this.hh = random(szMax)
this.dd = random(szMax)
this.col = color(random(255),random(255), random(255))
}
caja(){
push()
translate(this.x, this.y, this.z)
fill(this.col)
box(this.ww, this.hh, this.dd)
pop()
}
}

Comentarios
Publicar un comentario