コード例 #1
0
ファイル: SampleForm.cs プロジェクト: stjeong/OpenGL.Net
        private SceneObjectGeometry CreatePlane()
        {
            SceneObjectGeometry geometry = new SceneObjectGeometry("Plane");

            geometry.VertexArray = VertexArrays.CreatePlane(1.0f, 1.0f, -1.0f, 1, 1);
            // geometry.ObjectState.DefineState(new CullFaceState(FrontFaceDirection.Ccw, CullFaceMode.Back) { Culling = false });
            geometry.ProgramTag = ShadersLibrary.Instance.CreateProgramTag("OpenGL.Standard");

            return(geometry);
        }
コード例 #2
0
        private SceneObjectGeometry CreatePlane()
        {
            SceneObjectGeometry geometry = new SceneObjectGeometry("Plane");

            geometry.VertexArray = VertexArrays.CreatePlane(50.0f, 50.0f, 0.0f, 1, 1);
            geometry.ObjectState.DefineState(new CullFaceState(FrontFaceDirection.Ccw, CullFaceMode.Back));
            geometry.ObjectState.DefineState(new TransformState());

            MaterialState cubeMaterialState = new MaterialState();

            cubeMaterialState.FrontMaterial          = new MaterialState.Material(ColorRGBAF.ColorWhite * 0.5f);
            cubeMaterialState.FrontMaterial.Ambient  = ColorRGBAF.ColorBlack;
            cubeMaterialState.FrontMaterial.Diffuse  = ColorRGBAF.ColorWhite * 0.5f;
            cubeMaterialState.FrontMaterial.Specular = ColorRGBAF.ColorBlack;
            geometry.ObjectState.DefineState(cubeMaterialState);

            geometry.LocalModel.RotateX(-90.0);

            geometry.ProgramTag = ShadersLibrary.Instance.CreateProgramTag("OpenGL.Standard+PhongFragment");

            return(geometry);
        }