'use strict' let canvas=document.querySelector('canvas'), ctx = canvas.getContext('2d'), height=canvas.height, width=canvas.width; let k=400, k0=5; // настройки искожения проекции function getX(l,deg){return Math.cos(rad(deg))*l} function getY(l,deg){return Math.sin(rad(deg))*l} function rad(deg){return deg*Math.PI/180} function rnd(min, max){return Math.ceil(Math.random()*(max-min)+min)} //печать проекции фигуры 3d в 2d function print(obj, ctx){ let {catalog, path}=obj; ctx.beginPath(); for (let {line, point,f} of path){ let x=catalog[point].x-width/2, y=catalog[point].y-height/2, z=catalog[point].z; x=(x*k0)/(k0+z*(1/k))+width/2; y=(y*k0)/(k0+z*(1/k))+height/2 if (line && line!=='bezier') {ctx.lineTo(x,y)} else if(line==='bezier'){ ctx.bezierCurveTo( catalog[point].cp0x, catalog[point].cp0y, catalog[point].cp1x, catalog[point].cp1y, x,y )} else {ctx.moveTo(x,y)} if (f) { ctx.fillStyle=f; ctx.fill(); ctx.stroke(); ctx.beginPath(); } } ctx.stroke(); } //получение реальных координат поворотных точек function realFigure(obj){ let {catalog, real, path}=obj, {xReal, yReal, zReal, degXY, degXZ, degYZ}=real, res={catalog:[], path:[], real:{}}; for (let {x, y, z, cp0x, cp0y, cp1x, cp1y} of catalog){ // XY let lXY = Math.sqrt(x**2+y**2), csXY = x/lXY, degXY0 = !isNaN(csXY)? Math.acos(csXY):0, DXY= y<0? degXY-degXY0 : degXY+degXY0; x=Math.cos(DXY)*lXY; y=Math.sin(DXY)*lXY; // XZ let lXZ=Math.sqrt(x**2+z**2), csXZ = x/lXZ, degXZ0 = !isNaN(csXZ)? Math.acos(csXZ):0, DXZ = z<0? degXZ-degXZ0 : degXZ + degXZ0; x=Math.cos(DXZ)*lXZ; z=Math.sin(DXZ)*lXZ; // YZ let lYZ=Math.sqrt(y**2+z**2), csYZ = z/lYZ, degYZ0 = !isNaN(csYZ)? Math.acos(csYZ):0, DYZ = y<0? degYZ-degYZ0 : degYZ + degYZ0; z=Math.cos(DYZ)*lYZ; y=Math.sin(DYZ)*lYZ; // results x=x+xReal;y=y+yReal;z=z+zReal; res.catalog.push({x, y, z, cp0x, cp0y, cp1x, cp1y}) } res.path=path; return res; } function generateSnow(n=1){ let obj={}; let z=rnd(1,100)*100; let CY=-1*height/2; let CX=-1*width/2; let Xmin=(CX*(k0+z*(1/k))/k0)-CX; let Xmax=(k0*width-CX*z*(1/k))/k0; let x=rnd(Xmin,Xmax) let y=(CY*(k0+z*(1/k))/k0)-CY-rnd(1,200); obj.catalog=[];obj.path=[]; let l1=rnd(10,30); let h1=rnd(0,25); let l2=rnd(10,30); let h2=rnd(25,50); let l3=rnd(10,30); let h3=rnd(50,75); let l4=rnd(5,20); let h4=rnd(75,100); let sig = rnd(-1,1); sig=sig===0? 1:sig; let catalog=[ {x:0, y:0, z:0}, {x:0, y:100*n, z:0}, {x:0, y:h1*n, z:0}, {x:l1*n*sig, y:(h1+l1)*n, z:0}, {x:0, y:h2*n, z:0}, {x:-l2*n*sig, y:(h2+l2)*n, z:0}, {x:0, y:h3*n, z:0}, {x:l3*n*sig, y:(h3+l3)*n, z:0}, {x:0, y:h4*n, z:0}, {x:-l4*n*sig, y:(h4+l4)*n, z:0}, ] for (let i=0; i<360; i+=45){ obj.catalog.push(...catalog.map(({x,y,z})=>{ let rot=rad(i), lXY = Math.sqrt(x**2+y**2), csXY = x/lXY, degXY0 = !isNaN(csXY)? Math.acos(csXY):0, DXY= y<0? rot-degXY0 : rot+degXY0; x=Math.cos(DXY)*lXY; y=Math.sin(DXY)*lXY; return {x,y,z} })) } for (let i=0;i<80;i+=2){ obj.path.push({point:i,line:false}, {point:i+1, line:true}) } obj.real={xReal:x, yReal:y, zReal:z, degXY:0, degXZ:0, degYZ:0}; obj.behavior={vx:rnd(-5,5)/5, vy:4, vz:rnd(-5,-10), DXY:rad(rnd(-3,3)), DXZ:rad(rnd(-10,20)/10), DYZ:rad(0.0)}; obj.nextStep = function(width,height){ this.real.xReal=this.real.xReal+this.behavior.vx; this.real.yReal=this.real.yReal+this.behavior.vy; this.real.zReal=this.real.zReal+this.behavior.vz; this.real.degXY=this.real.degXY+this.behavior.DXY; this.real.degXZ=this.real.degXZ+this.behavior.DXZ; this.real.degYZ=this.real.degYZ+this.behavior.DYZ; let CX=-1*width/2; let Xmin=(CX*(k0+this.real.zReal*(1/k))/k0)-CX; let Xmax=(k0*width-CX*this.real.zReal*(1/k))/k0; if (this.real.xReal>Xmax || this.real.xRealheight) this.kill(); } obj.kill = function(){collection=collection.filter(obj=>obj!==this)} return obj } function render(collection, ctx){ kadr++; if(kadr==100 && collection.length<1500){ kadr=0; addSnow(); } ctx.strokeStyle='#baf7ffff'; ctx.fillStyle='#07082bff'; ctx.fillRect(0,0,width,height); for (let object of collection){ print(realFigure(object),ctx); object.nextStep(width,height); } } //________________надпись Код на салфетке let fs=width/1870; let symWdt=1; let hs=1 //height/919 let symbLy=height-100; let Symb_K={ catalog:[ //front {x:0*fs, y:0, z:0, yCopy:0},//0 {x:30*fs, y:0, z:0, yCopy:0},//1 {x:30*fs, y:-75*fs, z:0, yCopy:-75*fs},//2 {x:75*fs, y:0, z:0, yCopy:0},//3 {x:100*fs, y:0, z:0, yCopy:0},//4 {x:50*fs, y:-100*fs, z:0, yCopy:-100*fs},//5 {x:100*fs, y:-200*fs, z:0, yCopy:-200*fs},//6 {x:75*fs, y:-200*fs, z:0, yCopy:-200*fs},//7 {x:30*fs, y:-125*fs, z:0, yCopy:-125*fs},//8 {x:30*fs, y:-200*fs, z:0, yCopy:-200*fs},//9 {x:0*fs, y:-200*fs, z:0, yCopy:-200*fs},//10 // Back {x:0*fs, y:0, z:50*fs, yCopy:0},//11 {x:30*fs, y:0, z:50*fs, yCopy:0},//12 {x:30*fs, y:-75*fs, z:50*fs, yCopy:-75*fs},//13 {x:75*fs, y:0, z:50*fs, yCopy:0},//14 {x:100*fs, y:0, z:50*fs, yCopy:0},//15 {x:50*fs, y:-100*fs, z:50*fs, yCopy:-100*fs},//16 {x:100*fs, y:-200*fs, z:50*fs, yCopy:-200*fs},//17 {x:75*fs, y:-200*fs, z:50*fs, yCopy:-200*fs},//18 {x:30*fs, y:-125*fs, z:50*fs, yCopy:-125*fs},//19 {x:30*fs, y:-200*fs, z:50*fs, yCopy:-200*fs},//20 {x:0*fs, y:-200*fs, z:50*fs, yCopy:-200*fs},//21 ], path:[ //front {point:0, line:false}, {point:1, line:true}, {point:2, line:true}, {point:3, line:true}, {point:4, line:true}, {point:5, line:true}, {point:6, line:true}, {point:7, line:true}, {point:8, line:true}, {point:9, line:true}, {point:10, line:true}, {point:0, line:true}, //back {point:11, line:false}, {point:12, line:true}, {point:13, line:true}, {point:14, line:true}, {point:15, line:true}, {point:16, line:true}, {point:17, line:true}, {point:18, line:true}, {point:19, line:true}, {point:20, line:true}, {point:21, line:true}, {point:11, line:true}, // // {point:0, line:true}, {point:1, line:false}, {point:12, line:true}, {point:2, line:false}, {point:13, line:true}, {point:3, line:false}, {point:14, line:true}, {point:4, line:false}, {point:15, line:true}, {point:5, line:false}, {point:16, line:true}, {point:6, line:false}, {point:17, line:true}, {point:7, line:false}, {point:18, line:true}, {point:8, line:false}, {point:19, line:true}, {point:9, line:false}, {point:20, line:true}, {point:10, line:false}, {point:21, line:true}, {point:11, line:false}, {point:0, line:false}, {point:0, line:true, f:"#4d4dff"}, ], real:{ xReal:width/2-900*fs, yReal:symbLy, zReal:200*fs, degXY:0, degXZ:0, degYZ:0}, behavior:{ vx:0, vy:0, vz:0, DXY:0, DXZ:rad(rnd(-20,-10)/10), DYZ:0, kadr:0, dy:0.2, isJump:false, time:rnd(50,200) }, nextStep: function(){ if(!this.behavior.isJump)this.behavior.kadr++; this.real.xReal=this.real.xReal+this.behavior.vx; this.real.yReal=this.real.yReal+this.behavior.vy; this.real.zReal=this.real.zReal+this.behavior.vz; this.real.degXY=this.real.degXY+this.behavior.DXY; this.real.degXZ=this.real.degXZ+this.behavior.DXZ; this.real.degYZ=this.real.degYZ+this.behavior.DYZ; if(this.behavior.kadr>this.behavior.time-10){ for(let i=0; ithis.behavior.time){ this.behavior.kadr=0; this.behavior.isJump=true; let jump=rnd(-20*hs,-7*hs); let somersaults=180/(jump/0.2) this.behavior.vy=jump; if(jump<-12*hs) this.behavior.DXY=rad(somersaults); } if(this.real.yReal<=symbLy && this.behavior.isJump){ this.behavior.vy+=this.behavior.dy } else { this.behavior.vy=0; this.real.yReal=symbLy; this.behavior.isJump=false; this.behavior.DXY=0; this.real.degXY=0; } } } let Symb_o={ catalog:[ //front in {x:getX(50*fs,0), y:getY(50*fs,0)-50*fs, z:0, yCopy:getY(50*fs,0)-50*fs},//0 {x:getX(50*fs,45), y:getY(50*fs,45)-50*fs, z:0, yCopy:getY(50*fs,45)-50*fs},//1 {x:getX(50*fs,90), y:getY(50*fs,90)-50*fs, z:0, yCopy:getY(50*fs,90)-50*fs},//2 {x:getX(50*fs,135), y:getY(50*fs,135)-50*fs, z:0, yCopy:getY(50*fs,135)-50*fs},//3 {x:getX(50*fs,180), y:getY(50*fs,180)-50*fs, z:0, yCopy:getY(50*fs,180)-50*fs},//4 {x:getX(50*fs,180), y:getY(50*fs,180)-100*fs, z:0, yCopy:getY(50*fs,180)-100*fs},//5 {x:getX(50*fs,225), y:getY(50*fs,225)-100*fs, z:0, yCopy:getY(50*fs,225)-100*fs},//6 {x:getX(50*fs,270), y:getY(50*fs,270)-100*fs, z:0, yCopy:getY(50*fs,270)-100*fs},//7 {x:getX(50*fs,315), y:getY(50*fs,315)-100*fs, z:0, yCopy:getY(50*fs,315)-100*fs},//8 {x:getX(50*fs,0), y:getY(50*fs,0)-100*fs, z:0, yCopy:getY(50*fs,0)-100*fs},//9 //front out {x:getX(10*fs,0), y:getY(10*fs,0)-50*fs, z:0, yCopy:getY(10*fs,0)-50*fs},//10 {x:getX(10*fs,45), y:getY(10*fs,45)-50*fs, z:0, yCopy:getY(10*fs,45)-50*fs},//11 {x:getX(10*fs,90), y:getY(10*fs,90)-50*fs, z:0, yCopy:getY(10*fs,90)-50*fs},//12 {x:getX(10*fs,135), y:getY(10*fs,135)-50*fs, z:0, yCopy:getY(10*fs,135)-50*fs},//13 {x:getX(10*fs,180), y:getY(10*fs,180)-50*fs, z:0, yCopy:getY(10*fs,180)-50*fs},//14 {x:getX(10*fs,180), y:getY(10*fs,180)-100*fs, z:0, yCopy:getY(10*fs,180)-100*fs},//15 {x:getX(10*fs,225), y:getY(10*fs,225)-100*fs, z:0, yCopy:getY(10*fs,225)-100*fs},//16 {x:getX(10*fs,270), y:getY(10*fs,270)-100*fs, z:0, yCopy:getY(10*fs,270)-100*fs},//17 {x:getX(10*fs,315), y:getY(10*fs,315)-100*fs, z:0, yCopy:getY(10*fs,315)-100*fs},//18 {x:getX(10*fs,0), y:getY(10*fs,0)-100*fs, z:0, yCopy:getY(10*fs,0)-100*fs},//19 // Back {x:getX(50*fs,0), y:getY(50*fs,0)-50*fs, z:50*fs, yCopy:getY(50*fs,0)-50*fs},//20 {x:getX(50*fs,45), y:getY(50*fs,45)-50*fs, z:50*fs, yCopy:getY(50*fs,45)-50*fs},//21 {x:getX(50*fs,90), y:getY(50*fs,90)-50*fs, z:50*fs, yCopy:getY(50*fs,90)-50*fs},//22 {x:getX(50*fs,135), y:getY(50*fs,135)-50*fs, z:50*fs, yCopy:getY(50*fs,135)-50*fs},//23 {x:getX(50*fs,180), y:getY(50*fs,180)-50*fs, z:50*fs, yCopy:getY(50*fs,180)-50*fs},//24 {x:getX(50*fs,180), y:getY(50*fs,180)-100*fs, z:50*fs, yCopy:getY(50*fs,180)-100*fs},//25 {x:getX(50*fs,225), y:getY(50*fs,225)-100*fs, z:50*fs, yCopy:getY(50*fs,225)-100*fs},//26 {x:getX(50*fs,270), y:getY(50*fs,270)-100*fs, z:50*fs, yCopy:getY(50*fs,270)-100*fs},//27 {x:getX(50*fs,315), y:getY(50*fs,315)-100*fs, z:50*fs, yCopy:getY(50*fs,315)-100*fs},//28 {x:getX(50*fs,0), y:getY(50*fs,0)-100*fs, z:50*fs, yCopy:getY(50*fs,0)-100*fs},//29 {x:getX(10*fs,0), y:getY(10*fs,0)-50*fs, z:50*fs, yCopy:getY(10*fs,0)-50*fs},//30 {x:getX(10*fs,45), y:getY(10*fs,45)-50*fs, z:50*fs, yCopy:getY(10*fs,45)-50*fs},//31 {x:getX(10*fs,90), y:getY(10*fs,90)-50*fs, z:50*fs, yCopy:getY(10*fs,90)-50*fs},//32 {x:getX(10*fs,135), y:getY(10*fs,135)-50*fs, z:50*fs, yCopy:getY(10*fs,135)-50*fs},//33 {x:getX(10*fs,180), y:getY(10*fs,180)-50*fs, z:50*fs, yCopy:getY(10*fs,180)-50*fs},//34 {x:getX(10*fs,180), y:getY(10*fs,180)-100*fs, z:50*fs, yCopy:getY(10*fs,180)-100*fs},//35 {x:getX(10*fs,225), y:getY(10*fs,225)-100*fs, z:50*fs, yCopy:getY(10*fs,225)-100*fs},//36 {x:getX(10*fs,270), y:getY(10*fs,270)-100*fs, z:50*fs, yCopy:getY(10*fs,270)-100*fs},//37 {x:getX(10*fs,315), y:getY(10*fs,315)-100*fs, z:50*fs, yCopy:getY(10*fs,315)-100*fs},//38 {x:getX(10*fs,0), y:getY(10*fs,0)-100*fs, z:50*fs, yCopy:getY(10*fs,0)-100*fs},//39 ], path:[ //front in {point:0, line:false}, {point:1, line:true}, {point:2, line:true}, {point:3, line:true}, {point:4, line:true}, {point:5, line:true}, {point:6, line:true}, {point:7, line:true}, {point:8, line:true}, {point:9, line:true}, {point:0, line:true, /*f:"#4d4dff"*/}, //front out {point:10, line:false}, {point:11, line:true}, {point:12, line:true}, {point:13, line:true}, {point:14, line:true}, {point:15, line:true}, {point:16, line:true}, {point:17, line:true}, {point:18, line:true}, {point:19, line:true}, {point:10, line:true, /*f:'#07082bff'*/}, //back {point:20, line:false}, {point:21, line:true}, {point:22, line:true}, {point:23, line:true}, {point:24, line:true}, {point:25, line:true}, {point:26, line:true}, {point:27, line:true}, {point:28, line:true}, {point:29, line:true}, {point:20, line:true}, {point:30, line:false}, {point:31, line:true}, {point:32, line:true}, {point:33, line:true}, {point:34, line:true}, {point:35, line:true}, {point:36, line:true}, {point:37, line:true}, {point:38, line:true}, {point:39, line:true}, {point:30, line:true}, {point:0, line:false}, {point:20, line:true}, {point:1, line:false}, {point:21, line:true}, {point:2, line:false}, {point:22, line:true}, {point:3, line:false}, {point:23, line:true}, {point:4, line:false}, {point:24, line:true}, {point:5, line:false}, {point:25, line:true}, {point:6, line:false}, {point:26, line:true}, {point:7, line:false}, {point:27, line:true}, {point:8, line:false}, {point:28, line:true}, {point:9, line:false}, {point:29, line:true}, {point:10, line:false}, {point:30, line:true}, {point:11, line:false}, {point:31, line:true}, {point:12, line:false}, {point:32, line:true}, {point:13, line:false}, {point:33, line:true}, {point:14, line:false}, {point:34, line:true}, {point:15, line:false}, {point:35, line:true}, {point:16, line:false}, {point:36, line:true}, {point:17, line:false}, {point:37, line:true}, {point:18, line:false}, {point:38, line:true}, {point:19, line:false}, {point:39, line:true}, {point:0, line:false}, {point:1, line:true}, {point:2, line:true}, {point:3, line:true}, {point:4, line:true}, {point:5, line:true}, {point:6, line:true}, {point:7, line:true}, {point:8, line:true}, {point:9, line:true}, {point:0, line:true, f:"#4d4dff"}, //front out {point:10, line:false}, {point:11, line:true}, {point:12, line:true}, {point:13, line:true}, {point:14, line:true}, {point:15, line:true}, {point:16, line:true}, {point:17, line:true}, {point:18, line:true}, {point:19, line:true}, {point:10, line:true, f:'#07082bff'}, ], real:{ xReal:width/2-730*fs, yReal:symbLy, zReal:200*fs, degXY:0, degXZ:0, degYZ:0}, behavior:{ vx:0, vy:0, vz:0, DXY:0, DXZ:rad(rnd(-20,-10)/10), DYZ:0, kadr:0, dy:0.2, isJump:false, time:rnd(50,200) }, nextStep: function(){ if(!this.behavior.isJump)this.behavior.kadr++; this.real.xReal=this.real.xReal+this.behavior.vx; this.real.yReal=this.real.yReal+this.behavior.vy; this.real.zReal=this.real.zReal+this.behavior.vz; this.real.degXY=this.real.degXY+this.behavior.DXY; this.real.degXZ=this.real.degXZ+this.behavior.DXZ; this.real.degYZ=this.real.degYZ+this.behavior.DYZ; if(this.behavior.kadr>this.behavior.time-10){ for(let i=0; ithis.behavior.time){ this.behavior.kadr=0; this.behavior.isJump=true; let jump=rnd(-20*hs,-7*hs); let somersaults=180/(jump/0.2) this.behavior.vy=jump; if(jump<-12*hs) this.behavior.DYZ=rad(somersaults); } if(this.real.yReal<=symbLy && this.behavior.isJump){ this.behavior.vy+=this.behavior.dy } else { this.behavior.vy=0; this.real.yReal=symbLy; this.behavior.isJump=false; this.behavior.DYZ=0; this.real.degYZ=0; } } } let Symb_d={ catalog:[ //front {x:0*fs, y:20*fs, z:0, yCopy:20*fs},//0 {x:20*fs, y:20*fs, z:0, yCopy:20*fs},//1 {x:20*fs, y:0, z:0, yCopy:0},//2 {x:80*fs, y:0, z:0, yCopy:0},//3 {x:80*fs, y:20*fs, z:0, yCopy:20*fs},//4 {x:100*fs, y:20*fs, z:0, yCopy:20*fs},//5 {x:100*fs, y:-20*fs, z:0, yCopy:-20*fs},//6 {x:80*fs, y:-20*fs, z:0, yCopy:-20*fs},//7 {x:80*fs, y:-150*fs, z:0, yCopy:-150*fs},//8 {x:30*fs, y:-150*fs, z:0, yCopy:-150*fs},//9 {x:10*fs, y:-20*fs, z:0, yCopy:-20*fs},//10 {x:0, y:-20*fs, z:0, yCopy:-20*fs},//11 {x:30*fs, y:-20*fs, z:0, yCopy:-20*fs},//12 {x:45*fs, y:-125*fs, z:0, yCopy:-125*fs},//13 {x:60*fs, y:-125*fs, z:0, yCopy:-125*fs},//14 {x:60*fs, y:-20*fs, z:0, yCopy:-20*fs},//15 // Back {x:0*fs, y:20*fs, z:50*fs, yCopy:20*fs},//16 {x:20*fs, y:20*fs, z:50*fs, yCopy:20*fs},//17 {x:20*fs, y:0, z:50*fs, yCopy:0},//18 {x:80*fs, y:0, z:50*fs, yCopy:0},//19 {x:80*fs, y:20*fs, z:50*fs, yCopy:20*fs},//20 {x:100*fs, y:20*fs, z:50*fs, yCopy:20*fs},//21 {x:100*fs, y:-20*fs, z:50*fs, yCopy:-20*fs},//22 {x:80*fs, y:-20*fs, z:50*fs, yCopy:-20*fs},//23 {x:80*fs, y:-150*fs, z:50*fs, yCopy:-150*fs},//24 {x:30*fs, y:-150*fs, z:50*fs, yCopy:-150*fs},//25 {x:10*fs, y:-20*fs, z:50*fs, yCopy:-20*fs},//26 {x:0, y:-20*fs, z:50*fs, yCopy:-20*fs},//27 {x:30*fs, y:-20*fs, z:50*fs, yCopy:-20*fs},//28 {x:45*fs, y:-125*fs, z:50*fs, yCopy:-125*fs},//29 {x:60*fs, y:-125*fs, z:50*fs, yCopy:-125*fs},//30 {x:60*fs, y:-20*fs, z:50*fs, yCopy:-20*fs},//31 ], path:[ //front {point:0, line:false}, {point:1, line:true}, {point:2, line:true}, {point:3, line:true}, {point:4, line:true}, {point:5, line:true}, {point:6, line:true}, {point:7, line:true}, {point:8, line:true}, {point:9, line:true}, {point:10, line:true}, {point:11, line:true}, {point:0, line:true, /*f:"#4d4dff"*/}, {point:12, line:false}, {point:13, line:true}, {point:14, line:true}, {point:15, line:true}, {point:12, line:true, /*f:'#07082bff'*/}, //back {point:16, line:false}, {point:17, line:true}, {point:18, line:true}, {point:19, line:true}, {point:20, line:true}, {point:21, line:true}, {point:22, line:true}, {point:23, line:true}, {point:24, line:true}, {point:25, line:true}, {point:26, line:true}, {point:27, line:true}, {point:16, line:true}, {point:28, line:false}, {point:29, line:true}, {point:30, line:true}, {point:31, line:true}, {point:28, line:true}, // {point:0, line:false}, {point:16, line:true}, {point:1, line:false}, {point:17, line:true}, {point:2, line:false}, {point:18, line:true}, {point:3, line:false}, {point:19, line:true}, {point:4, line:false}, {point:20, line:true}, {point:5, line:false}, {point:21, line:true}, {point:6, line:false}, {point:22, line:true}, {point:7, line:false}, {point:23, line:true}, {point:8, line:false}, {point:24, line:true}, {point:9, line:false}, {point:25, line:true}, {point:10, line:false}, {point:26, line:true}, {point:11, line:false}, {point:27, line:true}, {point:12, line:false}, {point:28, line:true}, {point:13, line:false}, {point:29, line:true}, {point:14, line:false}, {point:30, line:true}, {point:15, line:false}, {point:31, line:true}, {point:0, line:false}, {point:0, line:true, f:"#4d4dff"}, ], real:{ xCopy:width/2-650*fs, xReal:width/2-650*fs, yReal:symbLy, zReal:200*fs, degXY:0, degXZ:0, degYZ:0}, setDirect: function(x0,y0,z0){ this.real.xReal=this.real.xReal-this.behavior.vx; this.real.yReal=this.real.yReal-this.behavior.vy; this.real.zReal=this.real.zReal-this.behavior.vz; this.real.degXY=this.real.degXY-this.behavior.DXY; this.real.degXZ=this.real.degXZ-this.behavior.DXZ; this.real.degYZ=this.real.degYZ-this.behavior.DYZ; let catalog=[{x:x0,y:y0,z:z0}]; let path=[{point:0, line:false}]; let real=this.real; let obj=realFigure({catalog,path,real}); this.real.xReal=obj.catalog[0].x; this.real.yReal=obj.catalog[0].y; this.real.zReal=obj.catalog[0].z; this.catalog=this.catalog.map(({x,y,z,yCopy})=>{ x-=x0; y-=y0; z-=z0; yCopy-=y0; return {x,y,z,yCopy} }) }, behavior:{ vx:0, vy:0, vz:0, DXY:0, DXZ:0, DYZ:0, kadr:0, dy:0.2, stepper:0, scene:0, isAction:false, time:rnd(50,100) }, isTime: function(t=0){ return this.behavior.kadr>this.behavior.time-t }, nextStep: function(){ if(!this.behavior.isAction)this.behavior.kadr++; this.real.xReal=this.real.xReal+this.behavior.vx; this.real.yReal=this.real.yReal+this.behavior.vy; this.real.zReal=this.real.zReal+this.behavior.vz; this.real.degXY=this.real.degXY+this.behavior.DXY; this.real.degXZ=this.real.degXZ+this.behavior.DXZ; this.real.degYZ=this.real.degYZ+this.behavior.DYZ; const sault = ()=>{ if(this.isTime()){ this.behavior.kadr=0; this.behavior.isAction=true; let jump=rnd(-20*hs,-7*hs); let somersaults=180/(jump/0.2); this.behavior.vx=-(this.real.xCopy-this.real.xReal)/(jump/0.2); this.behavior.vz=(this.real.zReal-200*fs)/(jump/0.2); this.behavior.vy=jump; if(jump<-12*hs) this.behavior.DYZ=rad(somersaults); } if(this.real.yReal<=symbLy && this.behavior.isAction){ this.behavior.vy+=this.behavior.dy; } else if(this.real.yReal>symbLy && this.behavior.isAction) { this.behavior.vx=0; this.behavior.vy=0; this.behavior.vz=0; this.real.yReal=symbLy; this.behavior.isAction=false; this.behavior.DYZ=0; this.real.degYZ=0; this.behavior.stepper++; } if(this.isTime(10)){ for(let i=0; i=rad(30)){ this.behavior.DXZ=0; this.behavior.DXY=rad(2); this.behavior.stepper++; } break; case 3: if(this.real.degXY>=0){ this.setDirect(100*fs,0,0); this.behavior.stepper++; } break; case 4: if(this.real.degXY>rad(30)){ this.behavior.DXY=0; this.behavior.DXZ=rad(-2); this.behavior.stepper++; } break; case 5: if(this.real.degXZ<=rad(0)){ this.behavior.DXZ=0; this.behavior.DXY=rad(-2); this.behavior.stepper++; } break; case 6: if(this.real.degXY<=0){ this.real.degXY=0; this.behavior.DXY=0; this.setDirect(-100*fs,0,0); this.behavior.isAction=false; this.behavior.stepper++; } break; case 7: sault(); break; case 8: this.behavior.stepper=0; } } } let Symb_n={ catalog:[ //front {x:0, y:0, z:0, yCopy:0},//0 {x:0, y:-150*fs, z:0, yCopy:-150*fs},//1 {x:30*fs, y:-150*fs, z:0, yCopy:-150*fs},//2 {x:30*fs, y:-85*fs, z:0, yCopy:-85*fs},//3 {x:70*fs, y:-85*fs, z:0, yCopy:-85*fs},//4 {x:70*fs, y:-150*fs, z:0, yCopy:-150*fs},//5 {x:100*fs, y:-150*fs, z:0, yCopy:-150*fs},//6 {x:100*fs, y:0, z:0, yCopy:0},//7 {x:70*fs, y:0, z:0, yCopy:0},//8 {x:70*fs, y:-65*fs, z:0, yCopy:-65*fs},//9 {x:30*fs, y:-65*fs, z:0, yCopy:-65*fs},//10 {x:30*fs, y:0, z:0, yCopy:0},//11 // Back {x:0, y:0, z:50*fs, yCopy:0},//12 {x:0, y:-150*fs, z:50*fs, yCopy:-150*fs},//13 {x:30*fs, y:-150*fs, z:50*fs, yCopy:-150*fs},//14 {x:30*fs, y:-85*fs, z:50*fs, yCopy:-85*fs},//15 {x:70*fs, y:-85*fs, z:50*fs, yCopy:-85*fs},//16 {x:70*fs, y:-150*fs, z:50*fs, yCopy:-150*fs},//17 {x:100*fs, y:-150*fs, z:50*fs, yCopy:-150*fs},//18 {x:100*fs, y:0, z:50*fs, yCopy:0},//19 {x:70*fs, y:0, z:50*fs, yCopy:0},//20 {x:70*fs, y:-65*fs, z:50*fs, yCopy:-65*fs},//21 {x:30*fs, y:-65*fs, z:50*fs, yCopy:-65*fs},//22 {x:30*fs, y:0, z:50*fs, yCopy:0},//23 ], path:[ //front {point:0, line:false}, {point:1, line:true}, {point:2, line:true}, {point:3, line:true}, {point:4, line:true}, {point:5, line:true}, {point:6, line:true}, {point:7, line:true}, {point:8, line:true}, {point:9, line:true}, {point:10, line:true}, {point:11, line:true}, {point:0, line:true,}, // //back {point:12, line:false}, {point:13, line:true}, {point:14, line:true}, {point:15, line:true}, {point:16, line:true}, {point:17, line:true}, {point:18, line:true}, {point:19, line:true}, {point:20, line:true}, {point:21, line:true}, {point:22, line:true}, {point:23, line:true}, {point:12, line:true}, // // {point:0, line:false}, {point:12, line:true}, {point:1, line:false}, {point:13, line:true}, {point:2, line:false}, {point:14, line:true}, {point:3, line:false}, {point:15, line:true}, {point:4, line:false}, {point:16, line:true}, {point:5, line:false}, {point:17, line:true}, {point:6, line:false}, {point:18, line:true}, {point:7, line:false}, {point:19, line:true}, {point:8, line:false}, {point:20, line:true}, {point:9, line:false}, {point:21, line:true}, {point:10, line:false}, {point:22, line:true}, {point:11, line:false}, {point:23, line:true}, {point:0, line:false}, {point:0, line:true, f:"#4d4dff"}, ], real:{ xCopy:width/2-410*fs, xReal:width/2-410*fs, yReal:symbLy, zReal:200*fs, degXY:0, degXZ:0, degYZ:0}, setDirect: function(x0,y0,z0){ this.real.xReal=this.real.xReal-this.behavior.vx; this.real.yReal=this.real.yReal-this.behavior.vy; this.real.zReal=this.real.zReal-this.behavior.vz; this.real.degXY=this.real.degXY-this.behavior.DXY; this.real.degXZ=this.real.degXZ-this.behavior.DXZ; this.real.degYZ=this.real.degYZ-this.behavior.DYZ; let catalog=[{x:x0,y:y0,z:z0}]; let path=[{point:0, line:false}]; let real=this.real; let obj=realFigure({catalog,path,real}); this.real.xReal=obj.catalog[0].x; this.real.yReal=obj.catalog[0].y; this.real.zReal=obj.catalog[0].z; this.catalog=this.catalog.map(({x,y,z,yCopy})=>{ x-=x0; y-=y0; z-=z0; yCopy-=y0; return {x,y,z,yCopy} }) }, behavior:{ vx:0, vy:0, vz:0, DXY:0, DXZ:0, DYZ:0, kadr:0, dy:0.2, stepper:0, scene:0, isAction:false, time:rnd(50,100) }, isTime: function(t=0){ return this.behavior.kadr>this.behavior.time-t }, nextStep: function(){ if(!this.behavior.isAction)this.behavior.kadr++; this.real.xReal=this.real.xReal+this.behavior.vx; this.real.yReal=this.real.yReal+this.behavior.vy; this.real.zReal=this.real.zReal+this.behavior.vz; this.real.degXY=this.real.degXY+this.behavior.DXY; this.real.degXZ=this.real.degXZ+this.behavior.DXZ; this.real.degYZ=this.real.degYZ+this.behavior.DYZ; const sault = ()=>{ if(this.isTime()){ this.behavior.kadr=0; this.behavior.isAction=true; let jump=rnd(-20*hs,-7*hs); let somersaults=180/(jump/0.2); this.behavior.vx=-(this.real.xCopy-this.real.xReal)/(jump/0.2); this.behavior.vz=(this.real.zReal-200*fs)/(jump/0.2); this.behavior.vy=jump; if(jump<-12*hs) this.behavior.DYZ=rad(somersaults); } if(this.real.yReal<=symbLy && this.behavior.isAction){ this.behavior.vy+=this.behavior.dy; } else if(this.real.yReal>symbLy && this.behavior.isAction) { this.behavior.vx=0; this.behavior.vy=0; this.behavior.vz=0; this.real.yReal=symbLy; this.behavior.isAction=false; this.behavior.DYZ=0; this.real.degYZ=0; this.behavior.stepper++; } if(this.isTime(10)){ for(let i=0; i=rad(30)){ this.behavior.DXZ=0; this.behavior.DXY=rad(2); this.behavior.stepper++; } break; case 3: if(this.real.degXY>=0){ this.setDirect(100*fs,0,0); this.behavior.stepper++; } break; case 4: if(this.real.degXY>rad(30)){ this.behavior.DXY=0; this.behavior.DXZ=rad(-2); this.behavior.stepper++; } break; case 5: if(this.real.degXZ<=rad(0)){ this.behavior.DXZ=0; this.behavior.DXY=rad(-2); this.behavior.stepper++; } break; case 6: if(this.real.degXY<=0){ this.real.degXY=0; this.behavior.DXY=0; this.setDirect(-100*fs,0,0); this.behavior.isAction=false; this.behavior.stepper++; } break; case 7: sault(); break; case 8: this.behavior.stepper=0; } } } let Symb_a1={ catalog:[ //front in {x:50*fs, y:0, z:0, yCopy:0},//0 {x:40*fs, y:-10*fs, z:0, yCopy:-10*fs},//1 {x:40*fs, y:-100*fs, z:0, yCopy:-100*fs},//2 {x:0, y:-150*fs, z:0, yCopy:-150*fs},//3 {x:-40*fs, y:-150*fs, z:0, yCopy:-150*fs},//4 {x:-40*fs, y:-120*fs, z:0, yCopy:-120*fs},//5 {x:-20*fs, y:-120*fs, z:0, yCopy:-120*fs},//6 {x:0*fs, y:-90*fs, z:0, yCopy:-90*fs},//7 {x:getX(50*fs,-110), y:getY(50*fs,-110)-50*fs, z:0,yCopy:getY(50*fs,-110)-50*fs},//8 {x:getX(50*fs,-135), y:getY(50*fs,-135)-50*fs, z:0,yCopy:getY(50*fs,-135)-50*fs},//9 {x:getX(50*fs,-180), y:getY(50*fs,-180)-50*fs, z:0,yCopy:getY(50*fs,-180)-50*fs},//10 {x:getX(50*fs,-225), y:getY(50*fs,-225)-50*fs, z:0, yCopy:getY(50*fs,-225)-50*fs},//11 {x:getX(50*fs,-270), y:getY(50*fs,-270)-50*fs, z:0, yCopy:getY(50*fs,-270)-50*fs},//12 {x:getX(50*fs,-290), y:getY(50*fs,-290)-50*fs, z:0, yCopy:getY(50*fs,-290)-50*fs},//13 {x:30*fs, y:0, z:0, yCopy:0},//14 {x:getX(20*fs,0), y:getY(20*fs,0)-50*fs, z:0,yCopy:getY(20*fs,0)-50*fs},//15 {x:getX(20*fs,45), y:getY(20*fs,45)-50*fs, z:0,yCopy:getY(20*fs,45)-50*fs},//16 {x:getX(20*fs,90), y:getY(20*fs,90)-50*fs, z:0,yCopy:getY(20*fs,90)-50*fs},//17 {x:getX(20*fs,135), y:getY(20*fs,135)-50*fs, z:0,yCopy:getY(20*fs,135)-50*fs},//18 {x:getX(20*fs,180), y:getY(20*fs,180)-50*fs, z:0,yCopy:getY(20*fs,180)-50*fs},//19 {x:getX(20*fs,225), y:getY(20*fs,225)-50*fs, z:0,yCopy:getY(20*fs,225)-50*fs},//20 {x:getX(20*fs,270), y:getY(20*fs,270)-50*fs, z:0,yCopy:getY(20*fs,270)-50*fs},//21 {x:getX(20*fs,315), y:getY(20*fs,315)-50*fs, z:0,yCopy:getY(20*fs,315)-50*fs},//22 // Back {x:50*fs, y:0, z:50*fs, yCopy:0},//23 {x:40*fs, y:-10*fs, z:50*fs, yCopy:-10*fs},//24 {x:40*fs, y:-100*fs, z:50*fs, yCopy:-100*fs},//25 {x:0, y:-150*fs, z:50*fs, yCopy:-150*fs},//26 {x:-40*fs, y:-150*fs, z:50*fs, yCopy:-150*fs},//27 {x:-40*fs, y:-120*fs, z:50*fs, yCopy:-120*fs},//28 {x:-20*fs, y:-120*fs, z:50*fs, yCopy:-120*fs},//29 {x:0*fs, y:-90*fs, z:50*fs, yCopy:-90*fs},//30 {x:getX(50*fs,-110), y:getY(50*fs,-110)-50*fs, z:50*fs, yCopy:getY(50*fs,-110)-50*fs},//31 {x:getX(50*fs,-135), y:getY(50*fs,-135)-50*fs, z:50*fs, yCopy:getY(50*fs,-135)-50*fs},//32 {x:getX(50*fs,-180), y:getY(50*fs,-180)-50*fs, z:50*fs, yCopy:getY(50*fs,-180)-50*fs},//33 {x:getX(50*fs,-225), y:getY(50*fs,-225)-50*fs, z:50*fs, yCopy:getY(50*fs,-225)-50*fs},//34 {x:getX(50*fs,-270), y:getY(50*fs,-270)-50*fs, z:50*fs, yCopy:getY(50*fs,-270)-50*fs},//35 {x:getX(50*fs,-290), y:getY(50*fs,-290)-50*fs, z:50*fs, yCopy:getY(50*fs,-290)-50*fs},//36 {x:30*fs, y:0, z:50*fs, yCopy:0},//37 {x:getX(20*fs,0), y:getY(20*fs,0)-50*fs, z:50*fs, yCopy:getY(20*fs,0)-50*fs},//38 {x:getX(20*fs,45), y:getY(20*fs,45)-50*fs, z:50*fs, yCopy:getY(20*fs,45)-50*fs},//39 {x:getX(20*fs,90), y:getY(20*fs,90)-50*fs, z:50*fs, yCopy:getY(20*fs,90)-50*fs},//40 {x:getX(20*fs,135), y:getY(20*fs,135)-50*fs, z:50*fs, yCopy:getY(20*fs,135)-50*fs},//41 {x:getX(20*fs,180), y:getY(20*fs,180)-50*fs, z:50*fs, yCopy:getY(20*fs,180)-50*fs},//42 {x:getX(20*fs,225), y:getY(20*fs,225)-50*fs, z:50*fs, yCopy:getY(20*fs,225)-50*fs},//43 {x:getX(20*fs,270), y:getY(20*fs,270)-50*fs, z:50*fs, yCopy:getY(20*fs,270)-50*fs},//44 {x:getX(20*fs,315), y:getY(20*fs,315)-50*fs, z:50*fs, yCopy:getY(20*fs,315)-50*fs},//45 ], path:[ //front in {point:0, line:false}, {point:1, line:true}, {point:2, line:true}, {point:3, line:true}, {point:4, line:true}, {point:5, line:true}, {point:6, line:true}, {point:7, line:true}, {point:8, line:true}, {point:9, line:true}, {point:10, line:true}, {point:11, line:true}, {point:12, line:true}, {point:13, line:true}, {point:14, line:true}, {point:0, line:true}, // {point:15, line:false}, {point:16, line:true}, {point:17, line:true}, {point:18, line:true}, {point:19, line:true}, {point:20, line:true}, {point:21, line:true}, {point:22, line:true}, {point:15, line:true,}, {point:23, line:false}, {point:24, line:true}, {point:25, line:true}, {point:26, line:true}, {point:27, line:true}, {point:28, line:true}, {point:29, line:true}, {point:30, line:true}, {point:31, line:true}, {point:32, line:true}, {point:33, line:true}, {point:34, line:true}, {point:35, line:true}, {point:36, line:true}, {point:37, line:true}, {point:23, line:true}, // {point:38, line:false}, {point:39, line:true}, {point:40, line:true}, {point:41, line:true}, {point:42, line:true}, {point:43, line:true}, {point:44, line:true}, {point:45, line:true}, {point:38, line:true}, {point:0, line:false}, {point:23, line:true}, {point:1, line:false}, {point:24, line:true}, {point:2, line:false}, {point:25, line:true}, {point:3, line:false}, {point:26, line:true}, {point:4, line:false}, {point:27, line:true}, {point:5, line:false}, {point:28, line:true}, {point:6, line:false}, {point:29, line:true}, {point:7, line:false}, {point:30, line:true}, {point:8, line:false}, {point:31, line:true}, {point:9, line:false}, {point:32, line:true}, {point:10, line:false}, {point:33, line:true}, {point:11, line:false}, {point:34, line:true}, {point:12, line:false}, {point:35, line:true}, {point:13, line:false}, {point:36, line:true}, {point:14, line:false}, {point:37, line:true}, {point:15, line:false}, {point:38, line:true}, {point:16, line:false}, {point:39, line:true}, {point:17, line:false}, {point:40, line:true}, {point:18, line:false}, {point:41, line:true}, {point:19, line:false}, {point:42, line:true}, {point:20, line:false}, {point:43, line:true}, {point:21, line:false}, {point:44, line:true}, {point:22, line:false}, {point:45, line:true}, {point:0, line:false}, {point:0, line:true, f:"#4d4dff"}, ], real:{ xReal:width/2-220*fs, yReal:symbLy, zReal:200*fs, degXY:0, degXZ:0, degYZ:0}, behavior:{ vx:0, vy:0, vz:0, DXY:0, DXZ:rad(rnd(-20,-10)/10), DYZ:0, kadr:0, dy:0.2, isJump:false, time:rnd(50,200) }, nextStep: function(){ if(!this.behavior.isJump)this.behavior.kadr++; this.real.xReal=this.real.xReal+this.behavior.vx; this.real.yReal=this.real.yReal+this.behavior.vy; this.real.zReal=this.real.zReal+this.behavior.vz; this.real.degXY=this.real.degXY+this.behavior.DXY; this.real.degXZ=this.real.degXZ+this.behavior.DXZ; this.real.degYZ=this.real.degYZ+this.behavior.DYZ; if (this.real.degXZ>rad(80) || this.real.degXZthis.behavior.time-10){ for(let i=0; ithis.behavior.time){ this.behavior.kadr=0; this.behavior.isJump=true; let jump=rnd(-20*hs,-7*hs); let somersaults=180/(jump/0.2) this.behavior.vy=jump; if(jump<-12*hs) this.behavior.DYZ=rad(somersaults); } if(this.real.yReal<=symbLy && this.behavior.isJump){ this.behavior.vy+=this.behavior.dy } else { this.behavior.vy=0; this.real.yReal=symbLy; this.behavior.isJump=false; this.behavior.DYZ=0; this.real.degYZ=0; } } } let Symb_с={ catalog:[ //front in {x:getX(50*fs,0), y:getY(50*fs,0)-50*fs, z:0, yCopy:getY(50*fs,0)-50*fs},//0 {x:getX(50*fs,45), y:getY(50*fs,45)-50*fs, z:0, yCopy:getY(50*fs,45)-50*fs},//1 {x:getX(50*fs,90), y:getY(50*fs,90)-50*fs, z:0, yCopy:getY(50*fs,90)-50*fs},//2 {x:getX(50*fs,135), y:getY(50*fs,135)-50*fs, z:0, yCopy:getY(50*fs,135)-50*fs},//3 {x:getX(50*fs,180), y:getY(50*fs,180)-50*fs, z:0, yCopy:getY(50*fs,180)-50*fs},//4 {x:getX(50*fs,180), y:getY(50*fs,180)-100*fs, z:0, yCopy:getY(50*fs,180)-100*fs},//5 {x:getX(50*fs,225), y:getY(50*fs,225)-100*fs, z:0, yCopy:getY(50*fs,225)-100*fs},//6 {x:getX(50*fs,270), y:getY(50*fs,270)-100*fs, z:0, yCopy:getY(50*fs,270)-100*fs},//7 {x:getX(50*fs,315), y:getY(50*fs,315)-100*fs, z:0, yCopy:getY(50*fs,315)-100*fs},//8 {x:getX(50*fs,0), y:getY(50*fs,0)-100*fs, z:0, yCopy:getY(50*fs,0)-100*fs},//9 {x:getX(10*fs,0), y:getY(10*fs,0)-100*fs, z:0, yCopy:getY(10*fs,0)-100*fs},//10 {x:getX(10*fs,-45), y:getY(10*fs,-45)-100*fs, z:0, yCopy:getY(10*fs,-45)-100*fs},//11 {x:getX(10*fs,-90), y:getY(10*fs,-90)-100*fs, z:0, yCopy:getY(10*fs,-90)-100*fs},//12 {x:getX(10*fs,-135), y:getY(10*fs,-135)-100*fs, z:0, yCopy:getY(10*fs,-135)-100*fs},//13 {x:getX(10*fs,-180), y:getY(10*fs,-180)-100*fs, z:0, yCopy:getY(10*fs,-180)-100*fs},//14 {x:getX(10*fs,-180), y:getY(10*fs,-180)-50*fs, z:0, yCopy:getY(10*fs,-180)-50*fs},//15 {x:getX(10*fs,-225), y:getY(10*fs,-225)-50*fs, z:0, yCopy:getY(10*fs,-225)-50*fs},//16 {x:getX(10*fs,-270), y:getY(10*fs,-270)-50*fs, z:0, yCopy:getY(10*fs,-270)-50*fs},//17 {x:getX(10*fs,-315), y:getY(10*fs,-315)-50*fs, z:0, yCopy:getY(10*fs,-315)-50*fs},//18 {x:getX(10*fs,0), y:getY(10*fs,0)-50*fs, z:0, yCopy:getY(10*fs,0)-50*fs},//19 // Back {x:getX(50*fs,0), y:getY(50*fs,0)-50*fs, z:50*fs, yCopy:getY(50*fs,0)-50*fs},//20 {x:getX(50*fs,45), y:getY(50*fs,45)-50*fs, z:50*fs, yCopy:getY(50*fs,45)-50*fs},//21 {x:getX(50*fs,90), y:getY(50*fs,90)-50*fs, z:50*fs, yCopy:getY(50*fs,90)-50*fs},//22 {x:getX(50*fs,135), y:getY(50*fs,135)-50*fs, z:50*fs, yCopy:getY(50*fs,135)-50*fs},//23 {x:getX(50*fs,180), y:getY(50*fs,180)-50*fs, z:50*fs, yCopy:getY(50*fs,180)-50*fs},//24 {x:getX(50*fs,180), y:getY(50*fs,180)-100*fs, z:50*fs, yCopy:getY(50*fs,180)-100*fs},//25 {x:getX(50*fs,225), y:getY(50*fs,225)-100*fs, z:50*fs, yCopy:getY(50*fs,225)-100*fs},//26 {x:getX(50*fs,270), y:getY(50*fs,270)-100*fs, z:50*fs, yCopy:getY(50*fs,270)-100*fs},//27 {x:getX(50*fs,315), y:getY(50*fs,315)-100*fs, z:50*fs, yCopy:getY(50*fs,315)-100*fs},//28 {x:getX(50*fs,0), y:getY(50*fs,0)-100*fs, z:50*fs, yCopy:getY(50*fs,0)-100*fs},//29 {x:getX(10*fs,0), y:getY(10*fs,0)-100*fs, z:50*fs, yCopy:getY(10*fs,0)-100*fs},//30 {x:getX(10*fs,-45), y:getY(10*fs,-45)-100*fs, z:50*fs, yCopy:getY(10*fs,-45)-100*fs},//31 {x:getX(10*fs,-90), y:getY(10*fs,-90)-100*fs, z:50*fs, yCopy:getY(10*fs,-90)-100*fs},//32 {x:getX(10*fs,-135), y:getY(10*fs,-135)-100*fs, z:50*fs, yCopy:getY(10*fs,-135)-100*fs},//33 {x:getX(10*fs,-180), y:getY(10*fs,-180)-100*fs, z:50*fs, yCopy:getY(10*fs,-180)-100*fs},//34 {x:getX(10*fs,-180), y:getY(10*fs,-180)-50*fs, z:50*fs, yCopy:getY(10*fs,-180)-50*fs},//35 {x:getX(10*fs,-225), y:getY(10*fs,-225)-50*fs, z:50*fs, yCopy:getY(10*fs,-225)-50*fs},//36 {x:getX(10*fs,-270), y:getY(10*fs,-270)-50*fs, z:50*fs, yCopy:getY(10*fs,-270)-50*fs},//37 {x:getX(10*fs,-315), y:getY(10*fs,-315)-50*fs, z:50*fs, yCopy:getY(10*fs,-315)-50*fs},//38 {x:getX(10*fs,0), y:getY(10*fs,0)-50*fs, z:50*fs, yCopy:getY(10*fs,0)-50*fs},//39 ], path:[ //front in {point:0, line:false}, {point:1, line:true}, {point:2, line:true}, {point:3, line:true}, {point:4, line:true}, {point:5, line:true}, {point:6, line:true}, {point:7, line:true}, {point:8, line:true}, {point:9, line:true}, {point:10, line:true}, {point:11, line:true}, {point:12, line:true}, {point:13, line:true}, {point:14, line:true}, {point:15, line:true}, {point:16, line:true}, {point:17, line:true}, {point:18, line:true}, {point:19, line:true}, {point:0, line:true}, // //back {point:20, line:false}, {point:21, line:true}, {point:22, line:true}, {point:23, line:true}, {point:24, line:true}, {point:25, line:true}, {point:26, line:true}, {point:27, line:true}, {point:28, line:true}, {point:29, line:true}, {point:30, line:true}, {point:31, line:true}, {point:32, line:true}, {point:33, line:true}, {point:34, line:true}, {point:35, line:true}, {point:36, line:true}, {point:37, line:true}, {point:38, line:true}, {point:39, line:true}, {point:20, line:true}, {point:0, line:false}, {point:20, line:true}, {point:1, line:false}, {point:21, line:true}, {point:2, line:false}, {point:22, line:true}, {point:3, line:false}, {point:23, line:true}, {point:4, line:false}, {point:24, line:true}, {point:5, line:false}, {point:25, line:true}, {point:6, line:false}, {point:26, line:true}, {point:7, line:false}, {point:27, line:true}, {point:8, line:false}, {point:28, line:true}, {point:9, line:false}, {point:29, line:true}, {point:10, line:false}, {point:30, line:true}, {point:11, line:false}, {point:31, line:true}, {point:12, line:false}, {point:32, line:true}, {point:13, line:false}, {point:33, line:true}, {point:14, line:false}, {point:34, line:true}, {point:15, line:false}, {point:35, line:true}, {point:16, line:false}, {point:36, line:true}, {point:17, line:false}, {point:37, line:true}, {point:18, line:false}, {point:38, line:true}, {point:19, line:false}, {point:39, line:true}, {point:0, line:false}, {point:0, line:true, f:"#4d4dff"}, ], real:{ xReal:width/2-30*fs, yReal:symbLy, zReal:200*fs, degXY:0, degXZ:0, degYZ:0}, behavior:{ vx:0, vy:0, vz:0, DXY:0, DXZ:rad(rnd(-20,-10)/10), DYZ:0, kadr:0, dy:0.2, isJump:false, time:rnd(50,200) }, nextStep: function(){ if(!this.behavior.isJump)this.behavior.kadr++; this.real.xReal=this.real.xReal+this.behavior.vx; this.real.yReal=this.real.yReal+this.behavior.vy; this.real.zReal=this.real.zReal+this.behavior.vz; this.real.degXY=this.real.degXY+this.behavior.DXY; this.real.degXZ=this.real.degXZ+this.behavior.DXZ; this.real.degYZ=this.real.degYZ+this.behavior.DYZ; if(this.behavior.kadr>this.behavior.time-10){ for(let i=0; ithis.behavior.time){ this.behavior.kadr=0; this.behavior.isJump=true; let jump=rnd(-20*hs,-7*hs); let somersaults=180/(jump/0.2) this.behavior.vy=jump; if(jump<-12*hs) this.behavior.DYZ=rad(somersaults); } if(this.real.yReal<=symbLy && this.behavior.isJump){ this.behavior.vy+=this.behavior.dy } else { this.behavior.vy=0; this.real.yReal=symbLy; this.behavior.isJump=false; this.behavior.DYZ=0; this.real.degYZ=0; } } } let Symb_a2={} Symb_a2.catalog=Symb_a1.catalog.map(({x,y,z,yCopy})=>{return {x,y,z,yCopy}}); Symb_a2.path=Symb_a1.path.map(({point,line,f})=>{return{point,line,f}}); Symb_a2.real={xReal:width/2+120*fs, yReal:symbLy, zReal:200*fs, degXY:0, degXZ:0, degYZ:0}; Symb_a2.behavior={vx:0, vy:0, vz:0, DXY:0, DXZ:rad(rnd(-10,20)/10), DYZ:0, kadr:0, dy:0.2, isJump:false, time:rnd(50,200)} Symb_a2.nextStep=Symb_a1.nextStep let Symb_l={ catalog:[ //front {x:10*fs, y:-20*fs, z:0, yCopy:-20*fs},//0 {x:20*fs, y:-10*fs, z:0, yCopy:-10*fs},//1 {x:30*fs, y:-30*fs, z:0, yCopy:-30*fs},//2 {x:40*fs, y:-150*fs, z:0, yCopy:-150*fs},//3 {x:100*fs, y:-150*fs, z:0, yCopy:-150*fs},//4 {x:100*fs, y:0, z:0, yCopy:0},//5 {x:80*fs, y:0, z:0, yCopy:0},//6 {x:80*fs, y:-130*fs, z:0, yCopy:-130*fs},//7 {x:60*fs, y:-130*fs, z:0, yCopy:-130*fs},//8 {x:50*fs, y:-20*fs, z:0, yCopy:-20*fs},//9 {x:40*fs, y:0, z:0, yCopy:0},//10 {x:20*fs, y:0, z:0, yCopy:0},//11 {x:10, y:-10*fs, z:0, yCopy:-10*fs},//12 {x:10*fs, y:-20*fs, z:50*fs, yCopy:-20*fs},//13 {x:20*fs, y:-10*fs, z:50*fs, yCopy:-10*fs},//14 {x:30*fs, y:-30*fs, z:50*fs, yCopy:-30*fs},//15 {x:40*fs, y:-150*fs, z:50*fs, yCopy:-150*fs},//16 {x:100*fs, y:-150*fs, z:50*fs, yCopy:-150*fs},//17 {x:100*fs, y:0, z:50*fs, yCopy:0},//18 {x:80*fs, y:0, z:50*fs, yCopy:0},//19 {x:80*fs, y:-130*fs, z:50*fs, yCopy:-130*fs},//20 {x:60*fs, y:-130*fs, z:50*fs, yCopy:-130*fs},//21 {x:50*fs, y:-20*fs, z:50*fs, yCopy:-20*fs},//22 {x:40*fs, y:0, z:50*fs, yCopy:0},//23 {x:20*fs, y:0, z:50*fs, yCopy:0},//24 {x:10, y:-10*fs, z:50*fs, yCopy:-10*fs},//25 ], path:[ //front {point:0, line:false}, {point:1, line:true}, {point:2, line:true}, {point:3, line:true}, {point:4, line:true}, {point:5, line:true}, {point:6, line:true}, {point:7, line:true}, {point:8, line:true}, {point:9, line:true}, {point:10, line:true}, {point:11, line:true}, {point:12, line:true}, {point:0, line:true}, {point:13, line:false}, {point:14, line:true}, {point:15, line:true}, {point:16, line:true}, {point:17, line:true}, {point:18, line:true}, {point:19, line:true}, {point:20, line:true}, {point:21, line:true}, {point:22, line:true}, {point:23, line:true}, {point:24, line:true}, {point:25, line:true}, {point:0, line:false}, {point:13, line:true}, {point:1, line:false}, {point:14, line:true}, {point:2, line:false}, {point:15, line:true}, {point:3, line:false}, {point:16, line:true}, {point:4, line:false}, {point:17, line:true}, {point:5, line:false}, {point:18, line:true}, {point:6, line:false}, {point:19, line:true}, {point:7, line:false}, {point:20, line:true}, {point:8, line:false}, {point:21, line:true}, {point:9, line:false}, {point:22, line:true}, {point:10, line:false}, {point:23, line:true}, {point:11, line:false}, {point:24, line:true}, {point:12, line:false}, {point:25, line:true}, {point:0, line:false}, {point:0, line:true, f:"#4d4dff"}, ], real:{ xReal:width/2+190*fs, yReal:symbLy, zReal:200*fs, degXY:0, degXZ:0, degYZ:0}, behavior:{ vx:0, vy:0, vz:0, DXY:0, DXZ:rad(rnd(-20,20)/10), DYZ:0, kadr:0, dy:0.2, isJump:false, time:rnd(50,200), }, nextStep: function(){ if(!this.behavior.isJump)this.behavior.kadr++; this.real.xReal=this.real.xReal+this.behavior.vx; this.real.yReal=this.real.yReal+this.behavior.vy; this.real.zReal=this.real.zReal+this.behavior.vz; this.real.degXY=this.real.degXY+this.behavior.DXY; this.real.degXZ=this.real.degXZ+this.behavior.DXZ; this.real.degYZ=this.real.degYZ+this.behavior.DYZ; if (this.real.degXZ>rad(80) || this.real.degXZthis.behavior.time-10){ for(let i=0; ithis.behavior.time){ this.behavior.kadr=0; this.behavior.isJump=true; let jump=rnd(-20*hs,-7*hs); let somersaults=180/(jump/0.2) this.behavior.vy=jump; if(jump<-12*hs) this.behavior.DXY=rad(somersaults); } if(this.real.yReal<=symbLy && this.behavior.isJump){ this.behavior.vy+=this.behavior.dy } else { this.behavior.vy=0; this.real.yReal=symbLy; this.behavior.isJump=false; this.behavior.DXY=0; this.real.degXY=0; } } } let Symb_f={ catalog:[ //front in {x:getX(40*fs,90)-10*fs, y:getY(40*fs,90)-80*fs, z:0, yCopy:getY(40*fs,90)-80*fs},//0 {x:getX(40*fs,135)-10*fs, y:getY(40*fs,135)-80*fs, z:0, yCopy:getY(40*fs,135)-80*fs},//1 {x:getX(40*fs,180)-10*fs, y:getY(40*fs,180)-80*fs, z:0, yCopy:getY(40*fs,180)-80*fs},//2 {x:getX(40*fs,225)-10*fs, y:getY(40*fs,225)-80*fs, z:0, yCopy:getY(40*fs,225)-80*fs},//3 {x:getX(40*fs,270)-10*fs, y:getY(40*fs,270)-80*fs, z:0, yCopy:getY(40*fs,270)-80*fs},//4 {x:-10*fs, y:-200*fs, z:0, yCopy:-200*fs},//5 {x:10*fs, y:-200*fs, z:0, yCopy:-200*fs},//6 {x:getX(40*fs,-90)+10*fs, y:getY(40*fs,-90)-80*fs, z:0, yCopy:getY(40*fs,-90)-80*fs},//7 {x:getX(40*fs,-45)+10*fs, y:getY(40*fs,-45)-80*fs, z:0, yCopy:getY(40*fs,-45)-80*fs},//8 {x:getX(40*fs, 0)+10*fs, y:getY(40*fs, 0)-80*fs, z:0, yCopy:getY(40*fs, 0)-80*fs},//9 {x:getX(40*fs, 45)+10*fs, y:getY(40*fs, 45)-80*fs, z:0, yCopy:getY(40*fs, 45)-80*fs},//10 {x:getX(40*fs, 90)+10*fs, y:getY(40*fs, 90)-80*fs, z:0, yCopy:getY(40*fs, 90)-80*fs},//11 {x:10*fs, y:20*fs, z:0, yCopy:20*fs},//12 {x:-10*fs, y:20*fs, z:0, yCopy:20*fs},//13 {x:getX(10*fs,90)-10*fs, y:getY(10*fs,90)-80*fs, z:0, yCopy:getY(10*fs,90)-80*fs},//14 {x:getX(10*fs,135)-10*fs, y:getY(10*fs,135)-80*fs, z:0, yCopy:getY(10*fs,135)-80*fs},//15 {x:getX(10*fs,180)-10*fs, y:getY(10*fs,180)-80*fs, z:0, yCopy:getY(10*fs,180)-80*fs},//16 {x:getX(10*fs,225)-10*fs, y:getY(10*fs,225)-80*fs, z:0, yCopy:getY(10*fs,225)-80*fs},//17 {x:getX(10*fs,270)-10*fs, y:getY(10*fs,270)-80*fs, z:0, yCopy:getY(10*fs,270)-80*fs},//18 {x:getX(10*fs,315)-10*fs, y:getY(10*fs,315)-80*fs, z:0, yCopy:getY(10*fs,315)-80*fs},//19 {x:getX(10*fs,0)-10*fs, y:getY(10*fs,0)-80*fs, z:0, yCopy:getY(10*fs,0)-80*fs},//20 {x:getX(10*fs,45)-10*fs, y:getY(10*fs,45)-80*fs, z:0, yCopy:getY(10*fs,45)-80*fs},//21 {x:getX(10*fs,90)+10*fs, y:getY(10*fs,90)-80*fs, z:0, yCopy:getY(10*fs,90)-80*fs},//22 {x:getX(10*fs,135)+10*fs, y:getY(10*fs,135)-80*fs, z:0, yCopy:getY(10*fs,135)-80*fs},//23 {x:getX(10*fs,180)+10*fs, y:getY(10*fs,180)-80*fs, z:0, yCopy:getY(10*fs,180)-80*fs},//24 {x:getX(10*fs,225)+10*fs, y:getY(10*fs,225)-80*fs, z:0, yCopy:getY(10*fs,225)-80*fs},//25 {x:getX(10*fs,270)+10*fs, y:getY(10*fs,270)-80*fs, z:0, yCopy:getY(10*fs,270)-80*fs},//26 {x:getX(10*fs,315)+10*fs, y:getY(10*fs,315)-80*fs, z:0, yCopy:getY(10*fs,315)-80*fs},//27 {x:getX(10*fs,0)+10*fs, y:getY(10*fs,0)-80*fs, z:0, yCopy:getY(10*fs,0)-80*fs},//28 {x:getX(10*fs,45)+10*fs, y:getY(10*fs,45)-80*fs, z:0, yCopy:getY(10*fs,45)-80*fs},//29 // back {x:getX(40*fs,90)-10*fs, y:getY(40*fs,90)-80*fs, z:50*fs, yCopy:getY(40*fs,90)-80*fs},//30 {x:getX(40*fs,135)-10*fs, y:getY(40*fs,135)-80*fs, z:50*fs, yCopy:getY(40*fs,135)-80*fs},//31 {x:getX(40*fs,180)-10*fs, y:getY(40*fs,180)-80*fs, z:50*fs, yCopy:getY(40*fs,180)-80*fs},//32 {x:getX(40*fs,225)-10*fs, y:getY(40*fs,225)-80*fs, z:50*fs, yCopy:getY(40*fs,225)-80*fs},//33 {x:getX(40*fs,270)-10*fs, y:getY(40*fs,270)-80*fs, z:50*fs, yCopy:getY(40*fs,270)-80*fs},//34 {x:-10*fs, y:-200*fs, z:50*fs, yCopy:-200*fs},//35 {x:10*fs, y:-200*fs, z:50*fs, yCopy:-200*fs},//36 {x:getX(40*fs,-90)+10*fs, y:getY(40*fs,-90)-80*fs, z:50*fs, yCopy:getY(40*fs,-90)-80*fs},//37 {x:getX(40*fs,-45)+10*fs, y:getY(40*fs,-45)-80*fs, z:50*fs, yCopy:getY(40*fs,-45)-80*fs},//38 {x:getX(40*fs, 0)+10*fs, y:getY(40*fs, 0)-80*fs, z:50*fs, yCopy:getY(40*fs, 0)-80*fs},//39 {x:getX(40*fs, 45)+10*fs, y:getY(40*fs, 45)-80*fs, z:50*fs, yCopy:getY(40*fs, 45)-80*fs},//40 {x:getX(40*fs, 90)+10*fs, y:getY(40*fs, 90)-80*fs, z:50*fs, yCopy:getY(40*fs, 90)-80*fs},//41 {x:10*fs, y:20*fs, z:50*fs, yCopy:20*fs},//42 {x:-10*fs, y:20*fs, z:50*fs, yCopy:20*fs},//43 {x:getX(10*fs,90)-10*fs, y:getY(10*fs,90)-80*fs, z:50*fs, yCopy:getY(10*fs,90)-80*fs},//44 {x:getX(10*fs,135)-10*fs, y:getY(10*fs,135)-80*fs, z:50*fs, yCopy:getY(10*fs,135)-80*fs},//45 {x:getX(10*fs,180)-10*fs, y:getY(10*fs,180)-80*fs, z:50*fs, yCopy:getY(10*fs,180)-80*fs},//46 {x:getX(10*fs,225)-10*fs, y:getY(10*fs,225)-80*fs, z:50*fs, yCopy:getY(10*fs,225)-80*fs},//47 {x:getX(10*fs,270)-10*fs, y:getY(10*fs,270)-80*fs, z:50*fs, yCopy:getY(10*fs,270)-80*fs},//48 {x:getX(10*fs,315)-10*fs, y:getY(10*fs,315)-80*fs, z:50*fs, yCopy:getY(10*fs,315)-80*fs},//49 {x:getX(10*fs,0)-10*fs, y:getY(10*fs,0)-80*fs, z:50*fs, yCopy:getY(10*fs,0)-80*fs},//50 {x:getX(10*fs,45)-10*fs, y:getY(10*fs,45)-80*fs, z:50*fs, yCopy:getY(10*fs,45)-80*fs},//51 {x:getX(10*fs,90)+10*fs, y:getY(10*fs,90)-80*fs, z:50*fs, yCopy:getY(10*fs,90)-80*fs},//52 {x:getX(10*fs,135)+10*fs, y:getY(10*fs,135)-80*fs, z:50*fs, yCopy:getY(10*fs,135)-80*fs},//53 {x:getX(10*fs,180)+10*fs, y:getY(10*fs,180)-80*fs, z:50*fs, yCopy:getY(10*fs,180)-80*fs},//54 {x:getX(10*fs,225)+10*fs, y:getY(10*fs,225)-80*fs, z:50*fs, yCopy:getY(10*fs,225)-80*fs},//55 {x:getX(10*fs,270)+10*fs, y:getY(10*fs,270)-80*fs, z:50*fs, yCopy:getY(10*fs,270)-80*fs},//56 {x:getX(10*fs,315)+10*fs, y:getY(10*fs,315)-80*fs, z:50*fs, yCopy:getY(10*fs,315)-80*fs},//57 {x:getX(10*fs,0)+10*fs, y:getY(10*fs,0)-80*fs, z:50*fs, yCopy:getY(10*fs,0)-80*fs},//58 {x:getX(10*fs,45)+10*fs, y:getY(10*fs,45)-80*fs, z:50*fs, yCopy:getY(10*fs,45)-80*fs},//59 // Back ], path:[ //front {point:0, line:false}, {point:1, line:true}, {point:2, line:true}, {point:3, line:true}, {point:4, line:true}, {point:5, line:true}, {point:6, line:true}, {point:7, line:true}, {point:8, line:true}, {point:9, line:true}, {point:10, line:true}, {point:11, line:true}, {point:12, line:true}, {point:13, line:true}, {point:0, line:true}, // {point:14, line:false}, {point:15, line:true}, {point:16, line:true}, {point:17, line:true}, {point:18, line:true}, {point:19, line:true}, {point:20, line:true}, {point:21, line:true}, {point:14, line:true}, {point:22, line:false}, {point:23, line:true}, {point:24, line:true}, {point:25, line:true}, {point:26, line:true}, {point:27, line:true}, {point:28, line:true}, {point:29, line:true}, {point:22, line:true}, // back {point:30, line:false}, {point:31, line:true}, {point:32, line:true}, {point:33, line:true}, {point:34, line:true}, {point:35, line:true}, {point:36, line:true}, {point:37, line:true}, {point:38, line:true}, {point:39, line:true}, {point:40, line:true}, {point:41, line:true}, {point:42, line:true}, {point:43, line:true}, {point:30, line:true}, {point:44, line:false}, {point:45, line:true}, {point:46, line:true}, {point:47, line:true}, {point:48, line:true}, {point:49, line:true}, {point:50, line:true}, {point:51, line:true}, {point:44, line:true}, {point:52, line:false}, {point:53, line:true}, {point:54, line:true}, {point:55, line:true}, {point:56, line:true}, {point:57, line:true}, {point:58, line:true}, {point:59, line:true}, {point:52, line:true}, {point:0, line:false}, {point:30, line:true}, {point:1, line:false}, {point:31, line:true}, {point:2, line:false}, {point:32, line:true}, {point:3, line:false}, {point:33, line:true}, {point:4, line:false}, {point:34, line:true}, {point:5, line:false}, {point:35, line:true}, {point:6, line:false}, {point:36, line:true}, {point:7, line:false}, {point:37, line:true}, {point:8, line:false}, {point:38, line:true}, {point:9, line:false}, {point:39, line:true}, {point:10, line:false}, {point:40, line:true}, {point:11, line:false}, {point:41, line:true}, {point:12, line:false}, {point:42, line:true}, {point:13, line:false}, {point:43, line:true}, {point:14, line:false}, {point:44, line:true}, {point:15, line:false}, {point:45, line:true}, {point:16, line:false}, {point:46, line:true}, {point:17, line:false}, {point:47, line:true}, {point:18, line:false}, {point:48, line:true}, {point:19, line:false}, {point:49, line:true}, {point:20, line:false}, {point:50, line:true}, {point:21, line:false}, {point:51, line:true}, {point:22, line:false}, {point:52, line:true}, {point:23, line:false}, {point:53, line:true}, {point:24, line:false}, {point:54, line:true}, {point:25, line:false}, {point:55, line:true}, {point:26, line:false}, {point:56, line:true}, {point:27, line:false}, {point:57, line:true}, {point:28, line:false}, {point:58, line:true}, {point:29, line:false}, {point:59, line:true}, {point:0, line:false}, {point:1, line:true}, {point:2, line:true}, {point:3, line:true}, {point:4, line:true}, {point:5, line:true}, {point:6, line:true}, {point:7, line:true}, {point:8, line:true}, {point:9, line:true}, {point:10, line:true}, {point:11, line:true}, {point:12, line:true}, {point:13, line:true}, {point:0, line:true, f:"#4d4dff"}, {point:14, line:false}, {point:15, line:true}, {point:16, line:true}, {point:17, line:true}, {point:18, line:true}, {point:19, line:true}, {point:20, line:true}, {point:21, line:true}, {point:14, line:true, f:'#07082bff'}, {point:22, line:false}, {point:23, line:true}, {point:24, line:true}, {point:25, line:true}, {point:26, line:true}, {point:27, line:true}, {point:28, line:true}, {point:29, line:true}, {point:22, line:true, f:'#07082bff'}, ], real:{ xReal:width/2+330*fs, yReal:symbLy, zReal:200*fs, degXY:rad(-4), degXZ:0, degYZ:0}, behavior:{ vx:0, vy:0, vz:0, DXY:0, DXZ:0, DYZ:0, kadr:0, dy:0.2, isJump:false, time:rnd(50,200), boost:rad(rnd(2,5)/100) }, nextStep: function(){ if(!this.behavior.isJump)this.behavior.kadr++; this.real.xReal=this.real.xReal+this.behavior.vx; this.real.yReal=this.real.yReal+this.behavior.vy; this.real.zReal=this.real.zReal+this.behavior.vz; this.real.degXY=this.real.degXY+this.behavior.DXY; this.real.degXZ=this.real.degXZ+this.behavior.DXZ; this.real.degYZ=this.real.degYZ+this.behavior.DYZ; this.behavior.DXZ+=this.behavior.boost; if (Math.abs(this.behavior.DXZ)>rad(20)){console.log(this.behavior.DXZ) ;this.behavior.boost*=-1}; if(this.behavior.kadr>this.behavior.time-10){ for(let i=0; ithis.behavior.time){ this.behavior.kadr=0; this.behavior.isJump=true; let jump=rnd(-20*hs,-7*hs); let somersaults=180/(jump/0.2) this.behavior.vy=jump; if(jump<-12*hs) this.behavior.DYZ=rad(somersaults); } if(this.real.yReal<=symbLy && this.behavior.isJump){ this.behavior.vy+=this.behavior.dy } else { this.behavior.vy=0; this.real.yReal=symbLy; this.behavior.isJump=false; this.behavior.DYZ=0; this.real.degYZ=0; } } } let Symb_e1={ catalog:[ //front in {x:getX(50*fs,0), y:getY(50*fs,0)-50*fs, z:0, yCopy:getY(50*fs,0)-50*fs},//0 {x:getX(50*fs,45), y:getY(50*fs,45)-50*fs, z:0, yCopy:getY(50*fs,45)-50*fs},//1 {x:getX(50*fs,90), y:getY(50*fs,90)-50*fs, z:0, yCopy:getY(50*fs,90)-50*fs},//2 {x:getX(50*fs,135), y:getY(50*fs,135)-50*fs, z:0, yCopy:getY(50*fs,135)-50*fs},//3 {x:getX(50*fs,180), y:getY(50*fs,180)-50*fs, z:0, yCopy:getY(50*fs,180)-50*fs},//4 {x:getX(50*fs,180), y:getY(50*fs,180)-100*fs, z:0, yCopy:getY(50*fs,180)-100*fs},//5 {x:getX(50*fs,225), y:getY(50*fs,225)-100*fs, z:0, yCopy:getY(50*fs,225)-100*fs},//6 {x:getX(50*fs,270), y:getY(50*fs,270)-100*fs, z:0, yCopy:getY(50*fs,270)-100*fs},//7 {x:getX(50*fs,315), y:getY(50*fs,315)-100*fs, z:0, yCopy:getY(50*fs,315)-100*fs},//8 {x:getX(50*fs,0), y:getY(50*fs,0)-100*fs, z:0, yCopy:getY(50*fs,0)-100*fs},//9 {x:50*fs, y:-75*fs, z:0, yCopy:-75*fs},//10 {x:-10*fs, y:-75*fs, z:0, yCopy:-75*fs},//11 {x:getX(10*fs,180), y:getY(10*fs,180)-100*fs, z:0, yCopy:getY(10*fs,180)-100*fs},//12 {x:getX(10*fs,225), y:getY(10*fs,225)-100*fs, z:0, yCopy:getY(10*fs,225)-100*fs},//13 {x:getX(10*fs,270), y:getY(10*fs,270)-100*fs, z:0, yCopy:getY(10*fs,270)-100*fs},//14 {x:getX(10*fs,315), y:getY(10*fs,315)-100*fs, z:0, yCopy:getY(10*fs,315)-100*fs},//15 {x:getX(10*fs,0), y:getY(10*fs,0)-100*fs, z:0, yCopy:getY(10*fs,0)-100*fs},//16 {x:getX(10*fs,45), y:getY(10*fs,45)-100*fs, z:0, yCopy:getY(10*fs,45)-100*fs},//17 {x:getX(10*fs,90), y:getY(10*fs,90)-100*fs, z:0, yCopy:getY(10*fs,90)-100*fs},//18 {x:getX(10*fs,135), y:getY(10*fs,135)-100*fs, z:0, yCopy:getY(10*fs,135)-100*fs},//19 {x:getX(10*fs,180), y:getY(10*fs,180)-50*fs, z:0, yCopy:getY(10*fs,180)-50*fs},//20 {x:getX(10*fs,135), y:getY(10*fs,135)-50*fs, z:0, yCopy:getY(10*fs,135)-50*fs},//21 {x:getX(10*fs,90), y:getY(10*fs,90)-50*fs, z:0, yCopy:getY(10*fs,90)-50*fs},//22 {x:getX(10*fs,45), y:getY(10*fs,45)-50*fs, z:0, yCopy:getY(10*fs,45)-50*fs},//23 {x:getX(10*fs,0), y:getY(10*fs,0)-50*fs, z:0, yCopy:getY(10*fs,0)-50*fs},//24 // Back {x:getX(50*fs,0), y:getY(50*fs,0)-50*fs, z:50*fs, yCopy:getY(50*fs,0)-50*fs},//25 {x:getX(50*fs,45), y:getY(50*fs,45)-50*fs, z:50*fs, yCopy:getY(50*fs,45)-50*fs},//26 {x:getX(50*fs,90), y:getY(50*fs,90)-50*fs, z:50*fs, yCopy:getY(50*fs,90)-50*fs},//27 {x:getX(50*fs,135), y:getY(50*fs,135)-50*fs, z:50*fs, yCopy:getY(50*fs,135)-50*fs},//28 {x:getX(50*fs,180), y:getY(50*fs,180)-50*fs, z:50*fs, yCopy:getY(50*fs,180)-50*fs},//29 {x:getX(50*fs,180), y:getY(50*fs,180)-100*fs, z:50*fs, yCopy:getY(50*fs,180)-100*fs},//30 {x:getX(50*fs,225), y:getY(50*fs,225)-100*fs, z:50*fs, yCopy:getY(50*fs,225)-100*fs},//31 {x:getX(50*fs,270), y:getY(50*fs,270)-100*fs, z:50*fs, yCopy:getY(50*fs,270)-100*fs},//32 {x:getX(50*fs,315), y:getY(50*fs,315)-100*fs, z:50*fs, yCopy:getY(50*fs,315)-100*fs},//33 {x:getX(50*fs,0), y:getY(50*fs,0)-100*fs, z:50*fs, yCopy:getY(50*fs,0)-100*fs},//34 {x:50*fs, y:-75*fs, z:50*fs, yCopy:-75*fs},//35 {x:-10*fs, y:-75*fs, z:50*fs, yCopy:-75*fs},//36 {x:getX(10*fs,180), y:getY(10*fs,180)-100*fs, z:50*fs, yCopy:getY(10*fs,180)-100*fs},//37 {x:getX(10*fs,225), y:getY(10*fs,225)-100*fs, z:50*fs, yCopy:getY(10*fs,225)-100*fs},//38 {x:getX(10*fs,270), y:getY(10*fs,270)-100*fs, z:50*fs, yCopy:getY(10*fs,270)-100*fs},//39 {x:getX(10*fs,315), y:getY(10*fs,315)-100*fs, z:50*fs, yCopy:getY(10*fs,315)-100*fs},//40 {x:getX(10*fs,0), y:getY(10*fs,0)-100*fs, z:50*fs, yCopy:getY(10*fs,0)-100*fs},//41 {x:getX(10*fs,45), y:getY(10*fs,45)-100*fs, z:50*fs, yCopy:getY(10*fs,45)-100*fs},//42 {x:getX(10*fs,90), y:getY(10*fs,90)-100*fs, z:50*fs, yCopy:getY(10*fs,90)-100*fs},//43 {x:getX(10*fs,135), y:getY(10*fs,135)-100*fs, z:50*fs, yCopy:getY(10*fs,135)-100*fs},//44 {x:getX(10*fs,180), y:getY(10*fs,180)-50*fs, z:50*fs, yCopy:getY(10*fs,180)-50*fs},//45 {x:getX(10*fs,135), y:getY(10*fs,135)-50*fs, z:50*fs, yCopy:getY(10*fs,135)-50*fs},//46 {x:getX(10*fs,90), y:getY(10*fs,90)-50*fs, z:50*fs, yCopy:getY(10*fs,90)-50*fs},//47 {x:getX(10*fs,45), y:getY(10*fs,45)-50*fs, z:50*fs, yCopy:getY(10*fs,45)-50*fs},//48 {x:getX(10*fs,0), y:getY(10*fs,0)-50*fs, z:50*fs, yCopy:getY(10*fs,0)-50*fs},//49 ], path:[ //front in {point:0, line:false}, {point:1, line:true}, {point:2, line:true}, {point:3, line:true}, {point:4, line:true}, {point:5, line:true}, {point:6, line:true}, {point:7, line:true}, {point:8, line:true}, {point:9, line:true}, {point:10, line:true}, {point:11, line:true}, {point:12, line:true}, {point:13, line:true}, {point:14, line:true}, {point:15, line:true}, {point:16, line:true}, {point:17, line:true}, {point:18, line:true}, {point:19, line:true}, {point:12, line:true}, {point:20, line:true}, {point:21, line:true}, {point:22, line:true}, {point:23, line:true}, {point:24, line:true}, {point:0, line:true}, {point:25, line:false}, {point:26, line:true}, {point:27, line:true}, {point:28, line:true}, {point:29, line:true}, {point:30, line:true}, {point:31, line:true}, {point:32, line:true}, {point:33, line:true}, {point:34, line:true}, {point:35, line:true}, {point:36, line:true}, {point:37, line:true}, {point:38, line:true}, {point:39, line:true}, {point:40, line:true}, {point:41, line:true}, {point:42, line:true}, {point:43, line:true}, {point:44, line:true}, {point:37, line:true}, {point:45, line:true}, {point:46, line:true}, {point:47, line:true}, {point:48, line:true}, {point:49, line:true}, {point:25, line:true}, {point:0, line:false}, {point:25, line:true}, {point:1, line:false}, {point:26, line:true}, {point:2, line:false}, {point:27, line:true}, {point:3, line:false}, {point:28, line:true}, {point:4, line:false}, {point:29, line:true}, {point:5, line:false}, {point:30, line:true}, {point:6, line:false}, {point:31, line:true}, {point:7, line:false}, {point:32, line:true}, {point:8, line:false}, {point:33, line:true}, {point:9, line:false}, {point:34, line:true}, {point:10, line:false}, {point:35, line:true}, {point:11, line:false}, {point:36, line:true}, {point:12, line:false}, {point:37, line:true}, {point:13, line:false}, {point:38, line:true}, {point:14, line:false}, {point:39, line:true}, {point:15, line:false}, {point:40, line:true}, {point:16, line:false}, {point:41, line:true}, {point:17, line:false}, {point:42, line:true}, {point:18, line:false}, {point:43, line:true}, {point:19, line:false}, {point:44, line:true}, {point:20, line:false}, {point:45, line:true}, {point:21, line:false}, {point:46, line:true}, {point:22, line:false}, {point:47, line:true}, {point:23, line:false}, {point:48, line:true}, {point:24, line:false}, {point:49, line:true}, {point:0, line:false}, {point:0, line:true, f:"#4d4dff"}, {point:12, line:false}, {point:13, line:true}, {point:14, line:true}, {point:15, line:true}, {point:16, line:true}, {point:17, line:true}, {point:18, line:true}, {point:19, line:true}, {point:12, line:true, f:'#07082bff'}, ], real:{ xReal:width/2+450*fs, yReal:symbLy, zReal:200*fs, degXY:0, degXZ:0, degYZ:0}, behavior:{ vx:0, vy:0, vz:0, DXY:0, DXZ:rad(rnd(-20,-10)/10), DYZ:0, kadr:0, dy:0.2, isJump:false, time:rnd(50,200) }, nextStep: function(){ if(!this.behavior.isJump)this.behavior.kadr++; this.real.xReal=this.real.xReal+this.behavior.vx; this.real.yReal=this.real.yReal+this.behavior.vy; this.real.zReal=this.real.zReal+this.behavior.vz; this.real.degXY=this.real.degXY+this.behavior.DXY; this.real.degXZ=this.real.degXZ+this.behavior.DXZ; this.real.degYZ=this.real.degYZ+this.behavior.DYZ; if(this.behavior.kadr>this.behavior.time-10){ for(let i=0; ithis.behavior.time){ this.behavior.kadr=0; this.behavior.isJump=true; let jump=rnd(-20*hs,-7*hs); let somersaults=180/(jump/0.2) this.behavior.vy=jump; if(jump<-12*hs) this.behavior.DYZ=rad(somersaults); } if(this.real.yReal<=symbLy && this.behavior.isJump){ this.behavior.vy+=this.behavior.dy } else { this.behavior.vy=0; this.real.yReal=symbLy; this.behavior.isJump=false; this.behavior.DYZ=0; this.real.degYZ=0; } } } let Symb_t={ catalog:[ //front {x:-10*fs, y:0, z:0, yCopy:0},//0 {x:-10*fs, y:-120*fs, z:0, yCopy:-120*fs},//1 {x:-40*fs, y:-120*fs, z:0, yCopy:-120*fs},//2 {x:-40*fs, y:-150*fs, z:0, yCopy:-150*fs},//3 {x:40*fs, y:-150*fs, z:0, yCopy:-150*fs},//4 {x:40*fs, y:-120*fs, z:0, yCopy:-120*fs},//5 {x:10*fs, y:-120*fs, z:0, yCopy:-120*fs},//6 {x:10*fs, y:0, z:0, yCopy:0},//7 // Back {x:-10*fs, y:0, z:50*fs, yCopy:0},//8 {x:-10*fs, y:-120*fs, z:50*fs, yCopy:-120*fs},//9 {x:-40*fs, y:-120*fs, z:50*fs, yCopy:-120*fs},//10 {x:-40*fs, y:-150*fs, z:50*fs, yCopy:-150*fs},//11 {x:40*fs, y:-150*fs, z:50*fs, yCopy:-150*fs},//12 {x:40*fs, y:-120*fs, z:50*fs, yCopy:-120*fs},//13 {x:10*fs, y:-120*fs, z:50*fs, yCopy:-120*fs},//14 {x:10*fs, y:0, z:50*fs, yCopy:0},//15 ], path:[ //front {point:0, line:false}, {point:1, line:true}, {point:2, line:true}, {point:3, line:true}, {point:4, line:true}, {point:5, line:true}, {point:6, line:true}, {point:7, line:true}, {point:0, line:true}, // back {point:8, line:false}, {point:9, line:true}, {point:10, line:true}, {point:11, line:true}, {point:12, line:true}, {point:13, line:true}, {point:14, line:true}, {point:15, line:true}, {point:8, line:true}, {point:0, line:false}, {point:8, line:true}, {point:1, line:false}, {point:9, line:true}, {point:2, line:false}, {point:10, line:true}, {point:3, line:false}, {point:11, line:true}, {point:4, line:false}, {point:12, line:true}, {point:5, line:false}, {point:13, line:true}, {point:6, line:false}, {point:14, line:true}, {point:7, line:false}, {point:15, line:true}, {point:0, line:false}, {point:0, line:true, f:"#4d4dff"}, ], real:{ xReal:width/2+580*fs, yReal:symbLy, zReal:200*fs, degXY:rad(-4), degXZ:0, degYZ:0}, behavior:{ vx:0, vy:0, vz:0, DXY:0, DXZ:0, DYZ:0, kadr:0, dy:0.2, isJump:false, time:rnd(50,200), boost:rad(rnd(2,5)/100) }, nextStep: function(){ if(!this.behavior.isJump)this.behavior.kadr++; this.real.xReal=this.real.xReal+this.behavior.vx; this.real.yReal=this.real.yReal+this.behavior.vy; this.real.zReal=this.real.zReal+this.behavior.vz; this.real.degXY=this.real.degXY+this.behavior.DXY; this.real.degXZ=this.real.degXZ+this.behavior.DXZ; this.real.degYZ=this.real.degYZ+this.behavior.DYZ; this.behavior.DXZ+=this.behavior.boost; if (Math.abs(this.behavior.DXZ)>rad(20)){console.log(this.behavior.DXZ) ;this.behavior.boost*=-1}; if(this.behavior.kadr>this.behavior.time-10){ for(let i=0; ithis.behavior.time){ this.behavior.kadr=0; this.behavior.isJump=true; let jump=rnd(-20*hs,-7*hs); let somersaults=180/(jump/0.2) this.behavior.vy=jump; if(jump<-12*hs) this.behavior.DYZ=rad(somersaults); } if(this.real.yReal<=symbLy && this.behavior.isJump){ this.behavior.vy+=this.behavior.dy } else { this.behavior.vy=0; this.real.yReal=symbLy; this.behavior.isJump=false; this.behavior.DYZ=0; this.real.degYZ=0; } } } let Symb_k={ catalog:[ //front {x:0*fs, y:0, z:0, yCopy:0},//0 {x:30*fs, y:0, z:0, yCopy:0},//1 {x:30*fs, y:-50*fs, z:0, yCopy:-50*fs},//2 {x:75*fs, y:0, z:0, yCopy:0},//3 {x:100*fs, y:0, z:0, yCopy:0},//4 {x:50*fs, y:-75*fs, z:0, yCopy:-75*fs},//5 {x:100*fs, y:-150*fs, z:0, yCopy:-150*fs},//6 {x:75*fs, y:-150*fs, z:0, yCopy:-150*fs},//7 {x:30*fs, y:-100*fs, z:0, yCopy:-100*fs},//8 {x:30*fs, y:-150*fs, z:0, yCopy:-150*fs},//9 {x:0*fs, y:-150*fs, z:0, yCopy:-150*fs},//10 // Back {x:0*fs, y:0, z:50*fs, yCopy:0},//11 {x:30*fs, y:0, z:50*fs, yCopy:0},//12 {x:30*fs, y:-50*fs, z:50*fs, yCopy:-50*fs},//13 {x:75*fs, y:0, z:50*fs, yCopy:0},//14 {x:100*fs, y:0, z:50*fs, yCopy:0},//15 {x:50*fs, y:-75*fs, z:50*fs, yCopy:-75*fs},//16 {x:100*fs, y:-150*fs, z:50*fs, yCopy:-150*fs},//17 {x:75*fs, y:-150*fs, z:50*fs, yCopy:-150*fs},//18 {x:30*fs, y:-100*fs, z:50*fs, yCopy:-100*fs},//19 {x:30*fs, y:-150*fs, z:50*fs, yCopy:-150*fs},//20 {x:0*fs, y:-150*fs, z:50*fs, yCopy:-150*fs},//21 ], path:[ //front {point:0, line:false}, {point:1, line:true}, {point:2, line:true}, {point:3, line:true}, {point:4, line:true}, {point:5, line:true}, {point:6, line:true}, {point:7, line:true}, {point:8, line:true}, {point:9, line:true}, {point:10, line:true}, {point:0, line:true}, //back {point:11, line:false}, {point:12, line:true}, {point:13, line:true}, {point:14, line:true}, {point:15, line:true}, {point:16, line:true}, {point:17, line:true}, {point:18, line:true}, {point:19, line:true}, {point:20, line:true}, {point:21, line:true}, {point:11, line:true}, // // {point:0, line:true}, {point:1, line:false}, {point:12, line:true}, {point:2, line:false}, {point:13, line:true}, {point:3, line:false}, {point:14, line:true}, {point:4, line:false}, {point:15, line:true}, {point:5, line:false}, {point:16, line:true}, {point:6, line:false}, {point:17, line:true}, {point:7, line:false}, {point:18, line:true}, {point:8, line:false}, {point:19, line:true}, {point:9, line:false}, {point:20, line:true}, {point:10, line:false}, {point:21, line:true}, {point:11, line:false}, {point:0, line:false}, {point:0, line:true, f:"#4d4dff"}, ], real:{ xReal:width/2+670*fs, yReal:symbLy, zReal:200*fs, degXY:0, degXZ:0, degYZ:0}, behavior:{ vx:0, vy:0, vz:0, DXY:0, DXZ:rad(rnd(-20,-10)/10), DYZ:0, kadr:0, dy:0.2, isJump:false, time:rnd(50,200) }, nextStep: function(){ if(!this.behavior.isJump)this.behavior.kadr++; this.real.xReal=this.real.xReal+this.behavior.vx; this.real.yReal=this.real.yReal+this.behavior.vy; this.real.zReal=this.real.zReal+this.behavior.vz; this.real.degXY=this.real.degXY+this.behavior.DXY; this.real.degXZ=this.real.degXZ+this.behavior.DXZ; this.real.degYZ=this.real.degYZ+this.behavior.DYZ; if (this.real.degXZ>rad(80) || this.real.degXZthis.behavior.time-10){ for(let i=0; ithis.behavior.time){ this.behavior.kadr=0; this.behavior.isJump=true; let jump=rnd(-20*hs,-7*hs); let somersaults=180/(jump/0.2) this.behavior.vy=jump; if(jump<-12*hs) this.behavior.DXY=rad(somersaults); } if(this.real.yReal<=symbLy && this.behavior.isJump){ this.behavior.vy+=this.behavior.dy } else { this.behavior.vy=0; this.real.yReal=symbLy; this.behavior.isJump=false; this.behavior.DXY=0; this.real.degXY=0; } } } let Symb_e2={}; Symb_e2.catalog=Symb_e1.catalog.map(({x,y,z,yCopy})=>{return {x,y,z,yCopy}}); Symb_e2.path=Symb_e1.path.map(({point,line,f})=>{return{point,line,f}}); Symb_e2.real={xReal:width/2+850*fs, yReal:symbLy, zReal:200*fs, degXY:0, degXZ:0, degYZ:0} Symb_e2.behavior={vx:0, vy:0, vz:0, DXY:0, DXZ:rad(rnd(-20,20)/10), DYZ:0, kadr:0, dy:0.2, jy:rnd(-15,-10), isJump:false, time:rnd(100,300)} Symb_e2.nextStep=Symb_e1.nextStep //________________ let room={ catalog:[ {x:0, y:height-200*fs+rnd(-50,50), z:0}, {x:width, y:height-200*fs+rnd(-50,50), z:0, cp0x:rnd(0, width/2),cp1x:rnd(width/2,width), cp0y:rnd(height-600*fs, height+200*fs), cp1y:rnd(height-600*fs, height+200*fs) }, {x:width, y:height, z:0}, {x:0,y:height, z:0} ], path:[ {point:0, line:false}, {point:1, line:'bezier'}, {point:2, line:true}, {point:3, line:true, f:'#ffffff9a'} ], real:{xReal:0, yReal:0, zReal:0, degXY:0, degXZ:0, degYZ:0}, nextStep:function(){return} } let collection=[ room, Symb_K, Symb_o, Symb_d, Symb_n, Symb_a1, Symb_с, Symb_a2, Symb_l, Symb_f, Symb_e1, Symb_t, Symb_k, Symb_e2, ]; let kadr=0; function addSnow(){ for(let i=1; i<100; i++){ collection.unshift(generateSnow(0.3*fs)) } } addSnow(); //запуск setInterval(()=>render(collection,ctx), 20);