X-Git-Url: http://git.osdn.jp/view?a=blobdiff_plain;f=test4%2FPsychlopsMain.cs;h=adff3c46711f8c88be9a87eeda48913cef4e2158;hb=bf316c025ef4a9eb346bcedbcf37dd18ed04c6f4;hp=c808b11b879d04f2c2ddfdb7888fb5ea7e9bad3b;hpb=08ee5e41fb9be4360175fc4c31941306cc9f39e8;p=psychlops%2Fsilverlight.git diff --git a/test4/PsychlopsMain.cs b/test4/PsychlopsMain.cs index c808b11..adff3c4 100644 --- a/test4/PsychlopsMain.cs +++ b/test4/PsychlopsMain.cs @@ -20,14 +20,15 @@ namespace PsychlopsSilverlight4test public void psychlops_main() { - throw new System.Exception("Speed"); //DotNumberS = new Psychlops.Widgets.Slider("test", new Interval(10, 500)); //Independent ind = new Independent(); cnvs = new Canvas(500, 500); - //Image img = new Image(20, 20); - //img.field(delegate(int x, int y) { return new Color(Math.sin(x + y)); }); + Image img = new Image(100, 100); + img.field(delegate(int x, int y) { return new Color(0.5 + 0.5 * Math.sin(x + y)); }); + Image img2 = new Image(100, 100); + img2.field(delegate(int x, int y) { return new Color(0.5 + 0.5 * Math.sin(x + y)); }); /* for (int x = 0; x < 20; x++) { @@ -42,11 +43,11 @@ namespace PsychlopsSilverlight4test //Declare background dots and target Rectangle[] BGDot = new Rectangle[2048]; for(int i=0; i<2048; i++){ - BGDot[i]=new Rectangle(); + BGDot[i]=new Rectangle(); } Rectangle[] Target= new Rectangle[10]; for(int i=0; i<10; i++){ - Target[i]=new Rectangle(); + Target[i]=new Rectangle(); } @@ -60,75 +61,73 @@ namespace PsychlopsSilverlight4test //Initialize positions of background dots for(int i=0; i<2048; i++){ - t=2.0*Math.PI*Math.random(1.0); - p=2.0*Math.PI*Math.random(1.0); - DotX[i]=t; - DotY[i]=p; - - x=BGRadii*Math.cos(t)*Math.cos(p); - y=BGRadii*Math.sin(t)*Math.cos(p); - BGDot[i].set(BGSize, BGSize); - BGDot[i].centering().shift(x,y); + t=2.0*Math.PI*Math.random(1.0); + p=2.0*Math.PI*Math.random(1.0); + DotX[i]=t; + DotY[i]=p; + + x=BGRadii*Math.cos(t)*Math.cos(p); + y=BGRadii*Math.sin(t)*Math.cos(p); + BGDot[i].set(BGSize, BGSize); + BGDot[i].centering().shift(x,y); } //Initialize positions of targets for(int i=0; i<10; i++)Target[i].set(TargetSize, TargetSize); double COS, SIN; - + DotNumber = 100; //Main stimulus loop while(true){ - //Clear the main window - cnvs.clear(Color.black); - - - temp=Axis/360*2*Math.PI; - COS=Math.cos(temp); - SIN=Math.sin(temp); - - //Calculate positions of background dots and set them - for(int i=0; i