xxxxxxxxxx
71
let snow
let a,b,c,d
function preload(){snow=loadModel("snow.obj")}
function setup() {
createCanvas(windowWidth, windowHeight,WEBGL);
extraCanvas=createGraphics(windowWidth, windowHeight,WEBGL);
extraCanvas.background(255)
}
function draw() {
background(0);
Snowing()
}
function Snowing(){
for (let countX=-windowWidth;countX<windowWidth;countX=countX+100){for(let countY=-windowHeight;countY<windowHeight;countY=countY+100){
push()
scale(0.3)
stroke(255)
translate(countX,countY+frameCount*4 ,0)
rotateX(frameCount*0.02)
rotateY(frameCount*0.02)
rotateZ(frameCount*0.02)
model(snow)
if(countY>windowHeight-10){countY=-windowHeight}//?
pop()
}
}
//extraCanvas
extraCanvas.clear()
extraCanvas.fill(255,0,0)
extraCanvas.ellipse(random(-windowWidth), random(-windowHeight,windowHeight),60)
image(extraCanvas,0,0)
}