void doUI() { background(40); stroke(60); fill(0); rect(10,50+70,480,330); //Mirror Line stroke(20); line(width/2,121,width/2,449); if(selected!=null&&displayNeuronUI) displayNeuronInfo(rawr,selected.n); drawGenome(meow,genomeAnchor); genomeAnchor=new position(25-genomeScroll.ratio()*(wWidth)*float(amount)*.5,50); genomeScroll.update(); textFont(uiFont,12); fill(120); if(useRK) { text("RK: ",width-30,14); fill(230,0,0); rect(width-13,5,6,8); } else { text("RK: ",width-30,14); fill(120,0,0); rect(width-13,5,6,8); } noStroke(); fill(120,140,155); textFont(uiFont,20); textMode(CORNER); text("NERVOUS SYSTEM",10,450); if(rawr.nodes.length>=maxNodes) fill(160,120,120); else fill(120); textFont(uiFont,12); text("point mass: "+rawr.nodes.length,10,20); fill(120); text("spring tension: "+float(int(rawr.tension*1000))/1000,90,20); text("collision tension: "+float(int(rawr.collisionTension*1000))/1000,90,30); text("friction constant: "+FRICTION_FORCE,200,20); text("display mode: "+displayMode,200,30); text("total energy: "+nf(rawr.totalEnergy,5,2),320,20); text("status: ",320,30); if(rawr.totalEnergy/rawr.nodes.length<60) text("stable",375,30); else { fill(220,0,0); text("unstable",375,30); } fill(120); if(selected!=null) { text("selected node ID: "+selectedID,mouseX+10,mouseY); text("selected node gene ID: "+selected.g.id,mouseX+10,mouseY+10); text("selected neuron ID: "+selected.n.id,mouseX+10,mouseY+20); } fill(150); textFont(uiFont,15); text("key",20,476); textFont(uiFont,12); if(key=='h') fill(120,220,190); else fill(150); text("'h' toggle UI",55,470); if(key=='1'||key=='2'||key=='3') fill(120,220,190); else fill(150); text("'1-3' display modes",55,488); /* if(key=='+') fill(220,190,190); else fill(150); text("'+' add node",55,488); */ if(key=='[') fill(220,190,190); else fill(150); text("'[' decrease tension",150,470); if(key==']') fill(220,190,190); else fill(150); text("']' increase tension",150,488); if(key=='g' || useGravity) fill(120,220,190); else fill(150); text("'g' toggle gravity",255,470); if(key=='c') fill(220,190,190); else fill(150); text("'c' create new",255,488); if(key=='s'||useSmooth) fill(220,190,190); else fill(150); text("'s' anti-alias",345,470); if(key=='m'||useMirror) fill(220,190,190); else fill(150); text("'m' mirror phenotype",345,488); /* for(int i=0;i0.01) rawr.tension-=0.005; if(key==']'&&rawr.tension<0.7) rawr.tension+=0.005; if(key=='c') { // playMode=false; selected=null; amount=int(random(minGenes,maxGenes)); rawr=new lattice(0); meow=new genome(amount); buildCreature(rawr,meow); } if(key=='1'||key=='2'||key=='3') displayMode=int(key)-48; if(key=='s') { if(useSmooth) { useSmooth=false; noSmooth(); } else { useSmooth=true; smooth(); } } if(key=='m') { if(useMirror==true) { selected=null; useMirror=false; rawr=new lattice(0); buildCreature(rawr,meow); } else { selected=null; useMirror=true; rawr=new lattice(0); buildCreature(rawr,meow); } } if(key=='r') { if(useRK) useRK=false; else useRK=true; } } void keyReleased() { key=' '; }