Exemplo n.º 1
0
        private void openGLControl1_Load(object sender, EventArgs e)
        {
            ProgramObject program = new ProgramObject(
               new VertexShader(Shaders.VERTEX_TRANSFORMATION_SHADER),
                   new FragmentShader(Shaders.DEFAULT_FRAGMENT_SHADER));

            WavefrontObj obj = new WavefrontObj(@"..\..\ashtray.obj", program, null);
            obj.transformation = Matrix4.Scale(0.15f) * Matrix4.CreateRotationX(MathHelper.PiOver2);

            openGLControl1.objects.Add(obj);

            openGLControl1.load();
        }
Exemplo n.º 2
0
        private void openGLControl1_Load(object sender, EventArgs e)
        {
            ProgramObject program = new ProgramObject(
               new VertexShader(Shaders.VERTEX_SHADER_TEXTURE),
                   new FragmentShader(Shaders.FRAGMENT_SHADER_ILLUMINATION));

            Light light = new Light(new Spherical(5, MathHelper.PiOver2, 0));

            obj = new WavefrontObj(@"..\..\ashtray.obj", program, null);
            obj.transformation = Matrix4.Scale(0.15f) * Matrix4.CreateRotationX(MathHelper.PiOver2);
            obj.light = light;

            LoadImageTexture.LoadTexture(@"..\..\texture.jpg");

            openGLControl1.objects.Add(obj);
            openGLControl1.light = light;

            openGLControl1.load();
        }