Changeset 13564
- Timestamp:
- 05/04/12 20:54:18 (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/FACT++/www/index.js
r13563 r13564 714 714 715 715 ctx.translate(x, y); 716 ctx.scale(1/2, Math.sqrt(3)/6);716 ctx.scale(1/2, 1/3); 717 717 718 718 ctx.beginPath(); … … 762 762 { 763 763 var ctx = beginDrawCam(80); 764 ctx.rotate(Math.PI/2); 765 ctx.scale(1, Math.sqrt(3)/2); 764 766 765 767 drawHex(ctx, -0.5, 0, data.charCodeAt(0)); 766 768 767 var gsSin60 = Math.sqrt(3)/2;768 769 769 var cnt = 1; 770 for (var ring=1; ring< =23; ring++)770 for (var ring=1; ring<24; ring++) 771 771 { 772 772 for (var s=0; s<6; s++) … … 779 779 switch (s) 780 780 { 781 case 0: x = ring-i*0.5; y = i*gsSin60;break;782 case 1: x = ring*0.5-i; y = ring*gsSin60;break;783 case 2: x = - (ring+i)*0.5; y = (ring-i)*gsSin60;break;784 case 3: x = 0.5*i-ring; y = -i*gsSin60;break;785 case 4: x = i-ring*0.5; y = -ring*gsSin60;break;786 case 5: x = (ring+i)*0.5; y = (-ring+i)*gsSin60; break;781 case 0: x = ring - i*0.5; y = + i; break; 782 case 1: x = ring*0.5 - i; y = ring ; break; 783 case 2: x = -ring*0.5 - i*0.5; y = ring - i; break; 784 case 3: x = -ring + i*0.5; y = - i; break; 785 case 4: x = -ring*0.5 + i; y = -ring ; break; 786 case 5: x = ring*0.5 + i*0.5; y = -ring + i; break; 787 787 } 788 788 789 if (x*x + y*y - x > 395.75) 790 continue; 791 792 drawHex(ctx, x-0.5, -y, data.charCodeAt(cnt)); 793 cnt++; 794 795 if (cnt!=1416) 796 continue; 797 798 drawHex(ctx, -6.5, -y, data.charCodeAt(1438)); 799 drawHex(ctx, -6.5, y, data.charCodeAt(1439)); 789 if (x*x + y*y*3/4 - x < 395.75) 790 drawHex(ctx, x-0.5, -y, data.charCodeAt(cnt++)); 800 791 } 801 792 } 802 793 } 803 794 795 drawHex(ctx, -6.5, 22, data.charCodeAt(1438)); 796 drawHex(ctx, -6.5, -22, data.charCodeAt(1439)); 797 804 798 ctx.restore(); 805 799 } … … 807 801 function drawCam(data) 808 802 { 809 var ctx = beginDrawCam(2 8);803 var ctx = beginDrawCam(27); 810 804 ctx.rotate(Math.PI/6); 805 ctx.scale(1, Math.sqrt(3)/2); 811 806 812 807 drawHex(ctx, 0, 0, data.charCodeAt(0)); 813 814 var gsSin60 = Math.sqrt(3)/2;815 808 816 809 var cnt = 1; … … 826 819 switch (s) 827 820 { 828 case 0: x = ring-i*0.5; y = i*gsSin60;break;829 case 1: x = ring*0.5-i; y = ring*gsSin60;break;830 case 2: x = - (ring+i)*0.5; y = (ring-i)*gsSin60;break;831 case 3: x = 0.5*i-ring; y = -i*gsSin60;break;832 case 4: x = i-ring*0.5; y = -ring*gsSin60;break;833 case 5: x = (ring+i)*0.5; y = (-ring+i)*gsSin60; break;821 case 0: x = ring - i*0.5; y = + i; break; 822 case 1: x = ring*0.5 - i; y = ring ; break; 823 case 2: x = -ring*0.5 - i*0.5; y = ring - i; break; 824 case 3: x = -ring + i*0.5; y = - i; break; 825 case 4: x = -ring*0.5 + i; y = -ring ; break; 826 case 5: x = ring*0.5 + i*0.5; y = -ring + i; break; 834 827 } 835 828 836 if ( Math.sqrt(x*x+y*y)>6.7)829 if (x*x + y*y*3/4 > 44) 837 830 continue; 831 838 832 if (ring==7 && i==6 && s==0) 839 833 continue; … … 845 839 continue; 846 840 847 drawHex(ctx, x, y, data.charCodeAt(cnt)); 848 cnt++; 841 drawHex(ctx, x, y, data.charCodeAt(cnt++)); 849 842 } 850 843 } … … 959 952 ctx.clearRect(0, 0, canv.width, canv.height); 960 953 961 drawGraph(canv, result);954 // drawGraph(canv, result); 962 955 963 956 // drawCam(result); 964 //drawFullCam(result);957 drawFullCam(result); 965 958 // drawFullCam(result); 966 959 // drawCamLegend(canv);
Note:
See TracChangeset
for help on using the changeset viewer.