X-Git-Url: http://git.osdn.jp/view?a=blobdiff_plain;f=test4%2FPsychlopsMain.cs;h=ad9a4c1503f1ca025a6b8779be1d3df4a1874e38;hb=a1aee2b11bf1d315eaf4a2bbd8a96464d3848202;hp=e7b6754780f382ae9a881551bed5bd11685ef34f;hpb=f363b7287669ba8b29a2a8ef1fd87ab8ca703d21;p=psychlops%2Fsilverlight.git diff --git a/test4/PsychlopsMain.cs b/test4/PsychlopsMain.cs index e7b6754..ad9a4c1 100644 --- a/test4/PsychlopsMain.cs +++ b/test4/PsychlopsMain.cs @@ -1,281 +1,100 @@ -/*using Psychlops; + +using Psychlops; -namespace PsychlopsSilverlight4test +namespace PsychlopsSilverlightApp { public class PsychlopsMain { - Psychlops.Canvas cnvs; - int i; - double x, y, z, t, p, temp, xx, yy; - - //Set Target Initial Value - double TargetEcce = 100.0, TargetSize = 5.0, TargetNumber = 5, Rotate = 0.0; - - //Set Background Initial Value - double DotNumber = 50, thetaSpeed = 3.0, Axis = 0.0, BGRadii = 150, BGSize = 5.0; - public void psychlops_main() { - cnvs = new Canvas(500, 500); - - //Declare background dots and target - Rectangle[] BGDot = new Rectangle[2048]; - for(int i=0; i<2048; i++){ - BGDot[i]=new Rectangle(); - } - Rectangle[] Target= new Rectangle[10]; - for(int i=0; i<10; i++){ - Target[i]=new Rectangle(); - } - - - //Declare Matrix to keep back ground dots' coordinate value - double[] DotX=new double[2048]; - double[] DotY = new double[2048]; - - - //Set Independent variables to manipulate - - - //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); - } - - //Initialize positions of targets - for(int i=0; i<10; i++)Target[i].set(TargetSize, TargetSize); - - double COS, SIN; - DotNumber = 200; - //Main stimulus loop - while(true){ - //Clear the main window - cnvs.clear(Color.green); - - - 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