Esempio n. 1
0
        protected override void OnLoad(EventArgs e)
        {
            DefaultGraphicsBehaviourLoader.InitializeDefaultGraphicsBehaviour();
            camera = new Camera((GameWindow)this);

            manMesh = new UnlitMesh("../../TestGeometries/man.obj", "../../Textures/manTexture.png");

            previousState = Keyboard.GetState();

            base.OnLoad(e);
        }
Esempio n. 2
0
        protected override void OnLoad(EventArgs e)
        {
            DefaultGraphicsBehaviourLoader.InitializeDefaultGraphicsBehaviour();
            GL.CullFace(CullFaceMode.FrontAndBack);
            //GL.Enable(GL.CullFace);
            camera = new Camera((GameWindow)this);
            camera.Move(new Vector3(0f, -13f, -32f));

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

            manMaterial = new Material(
                "../../Textures/manTexture.png", // texturePath
                Vector3.One,                     //Ambient color
                0.005f,                          //Ambient Intensity
                1f,                              //Specular strength
                4                                //Shininess
                );
            manMesh = new Mesh(
                new Vector3(0f, 0f, 0f),        //Position
                Vector3.Zero,                   //Rotation
                1f,                             //Scale
                "../../TestGeometries/Man.obj", //Geometry path
                manMaterial                     //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(-3f, 0f, 3f),                //Position
                Vector3.Zero,                            //Rotation
                3f,                                      //Scale
                "../../TestGeometries/TestGeometry.obj", //Geometry path
                woodMaterial                             //material
                );

            groundMaterial = new Material(
                "../../Textures/pebbleTexture.jpg", // texturePath
                Vector3.One,                        //Ambient color
                0.05f,                              //Ambient Intensity
                5f,                                 //Specular strength
                10                                  //Shininess
                );
            groundMesh = new Mesh(
                new Vector3(0f, 0f, 3f),           //Position
                Vector3.Zero,                      //Rotation
                3f,                                //Scale
                "../../TestGeometries/Ground.obj", //Geometry path
                groundMaterial                     //material
                );

            sun = new DirectionalLight(
                new Vector3(0f, -1f, 0f), //Direction
                Vector3.One,              //Color
                1f                        //Intensity
                );
            //lightHolder.Add(sun);
            spotLight = new SpotLight(
                indicatorPosition,    //position
                -1 * Vector3.UnitY,   //direction
                Vector3.One,          //color
                600f,                 //intensity
                40f,
                0.1f,
                0.1f,
                0.1f,
                0.01f
                );
            lightHolder.Add(spotLight);

            previousState = Keyboard.GetState();

            base.OnLoad(e);
        }
Esempio n. 3
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);
        }