Пример #1
0
        protected override void OnLoad(EventArgs e)
        {
            drawMode      = DrawMode.Wireframe;
            previousState = Keyboard.GetState();

            camera = new Camera((GameWindow)this);

            houseMaterial = new Material(
                "../../Textures/House.png", // texturePath
                Vector3.One,                //Ambient color
                0.005f,                     //Ambient Intensity
                1f,                         //Specular strength
                4                           //Shininess
                );
            house = new Mesh(
                new Vector3(0f, 0f, 0f),           //Position
                Vector3.Zero,                      //Rotation
                1f,                                //Scale
                "../../TestGeometries/Sphere.obj", //Geometry path
                houseMaterial                      //material
                );

            lightHolder = new LightHolder();

            sun = new DirectionalLight(
                Vector3.One,       //direction
                Vector3.One,       //color
                1f                 //intensity
                );

            lightHolder.Add(sun);

            base.OnLoad(e);
        }
Пример #2
0
        public Form1()
        {
            InitializeComponent();
            lh             = new LightHolderSparta();
            lc             = new lightcaller();
            gkh            = new globalKeyboardHook();
            lh.ActiveColor = new LightTestLib.Color(10, 50, 80);
            //lc.ButtonC += lh.SetOtherColor;

            notifyIcon1.Visible = true;
            // добавляем Эвент или событие по 2му клику мышки,
            //вызывая функцию  notifyIcon1_MouseDoubleClick
            this.notifyIcon1.MouseDoubleClick += new MouseEventHandler(notifyIcon1_MouseDoubleClick);
            List <MenuItem> i = new List <MenuItem>();

            i.Add(new MenuItem("Hook", Hook_Click));
            i.Add(new MenuItem("Blink", button3_Click));
            this.notifyIcon1.ContextMenu = new ContextMenu(i.ToArray());

            // добавляем событие на изменение окна
            this.Resize += new System.EventHandler(this.Form1_Resize);
        }
Пример #3
0
        static void BasicFunc()
        {
            ILightHolder lh;

            LogitechGSDK.LogiLedInitWithName("SetTargetZone Sample C#");

            if (true)
            {
                lh = new LightHolderSparta();
            }
            else
            {
                lh = new LightHolder();
            }

            List <string> menu = new List <string>
            {
                "r - random show",
                "l - later start random show",
                "b - blink",
                "s - set color",
                "p - pulse"
            };


            foreach (string s in menu)
            {
                Console.WriteLine(s);
            }


            string answerA = Console.ReadLine();


            if (answerA.isFirstKey('r'))
            {
                lh.RandomShowAsync(300, lh.BaseColors);
            }

            if (answerA.isFirstKey('l'))
            {
                Console.WriteLine("When start?");

                ParameterMaster pm = new ParameterMaster(new List <string> {
                    "Hour", "Minute"
                });

                PauseTo(pm.GetInt("Hour"), pm.GetInt("Minute"));
                lh.RandomShowAsync(300, lh.BaseColors);
            }

            if (answerA.isFirstKey('b'))
            {
                List <Color> c = new List <Color>();
                c.Add(ParameterMaster.GetColor("Insert color!"));
                c.Add(new Color(0, 0, 0));

                int gap = 400;

                lh.BlinkListAsync(c, gap);
            }

            if (answerA.isFirstKey('s'))
            {
                lh.ActiveColor = ParameterMaster.GetColor("Insert color!");
            }

            if (answerA.isFirstKey('p'))
            {
                ParameterMaster pm = new ParameterMaster(new List <string> {
                    "int"
                });
                lh.PulseAsync(ParameterMaster.GetColor("Insert color!"), pm.GetInt("int"));
                Console.ReadLine();
            }
        }
Пример #4
0
        protected override void OnLoad(EventArgs e)
        {
            DefaultGraphicsBehaviourLoader.InitializeDefaultGraphicsBehaviour();
            camera = new Camera((GameWindow)this);
            camera.Move(new Vector3(0f, 0f, 6f));

            lamp = new UnlitMesh("../../TestGeometries/point.obj", "../../Textures/default.jpg");

            unlitMesh = new UnlitMesh("../../TestGeometries/TestGeometry.obj", "../../Textures/WoodTexture.png");


            brickMaterial = new Material(
                "../../Textures/BrickTexture.png", // texturePath
                Vector3.One,                       //Ambient color
                0.05f,                             //Ambient Intensity
                1f,                                //Specular strength
                4                                  //Shininess
                );
            brickMesh = new Mesh(
                new Vector3(-3f, 0f, 0f),                //Position
                Vector3.Zero,                            //Rotation
                1f,                                      //Scale
                "../../TestGeometries/TestGeometry.obj", //Geometry path
                brickMaterial                            //material
                );

            woodMaterial = new Material(
                "../../Textures/WoodTexture.png", // texturePath
                Vector3.One,                      //Ambient color
                0.05f,                            //Ambient Intensity
                5f,                               //Specular strength
                10                                //Shininess
                );
            woodMesh = new Mesh(
                new Vector3(0f, 0f, 3f),                 //Position
                Vector3.Zero,                            //Rotation
                1f,                                      //Scale
                "../../TestGeometries/TestGeometry.obj", //Geometry path
                woodMaterial                             //material
                );

            metalMaterial = new Material(
                "../../Textures/MetalTexture.png", // texturePath
                Vector3.One,                       //Ambient color
                0.05f,                             //Ambient Intensity
                20f,                               //Specular strength
                20                                 //Shininess
                );
            metalMesh = new Mesh(
                new Vector3(3f, 0f, 0f),                 //Position
                Vector3.Zero,                            //Rotation
                1f,                                      //Scale
                "../../TestGeometries/TestGeometry.obj", //Geometry path
                metalMaterial                            //material
                );


            lightHolder = new LightHolder();

            whitePointLight = new PointLight(
                new Vector3(0f, 3f, 0f), //position
                new Vector3(1f, 1f, 1f), //color
                0.5f                     //intensity
                );
            lightHolder.Add(whitePointLight);

            sunLight = new DirectionalLight(
                new Vector3(1f, -1f, 1f), //Direction
                Vector3.One,              //Color
                0.5f                      //Intensity
                );
            lightHolder.Add(sunLight);

            base.OnLoad(e);
        }