当前位置: 首页>>代码示例>>C#>>正文


C# GraphicsContext.SetCullFace方法代码示例

本文整理汇总了C#中GraphicsContext.SetCullFace方法的典型用法代码示例。如果您正苦于以下问题:C# GraphicsContext.SetCullFace方法的具体用法?C# GraphicsContext.SetCullFace怎么用?C# GraphicsContext.SetCullFace使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在GraphicsContext的用法示例。


在下文中一共展示了GraphicsContext.SetCullFace方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: Init

        static bool Init()
        {
            graphics = new GraphicsContext();

            //Window size: Change if Tablet, default is Vita
            graphics.SetViewport(0, 0, graphics.Screen.Width, graphics.Screen.Height);

            //Background Color Set
            graphics.SetClearColor(0.0f, 0.0f, 0.0f, 0.0f);

            program = new ShaderProgram("/Application/shaders/VertexColor.cgx");
            program.SetUniformBinding(0, "WorldViewProj");

            //Detect if processing shadow or not

            program.SetUniformBinding(1, "ShadowOn");
            program.SetUniformBinding(2, "LocalLightDirection");
            program.SetUniformBinding(3, "EyePosition");
            program.SetUniformBinding(4, "K_A");
            program.SetUniformBinding(5, "K_D");
            program.SetUniformBinding(6, "K_S");
            program.SetUniformBinding(7, "Shininess");
            program.SetUniformBinding(8, "Modelmatrix");
            program.SetUniformBinding(9, "ModelmatrixIT");
            program.SetUniformBinding(10, "viewMatrix");
            program.SetUniformBinding(11, "projMatrix");

            program.SetAttributeBinding(0, "a_Position");
            program.SetAttributeBinding(1, "a_Color");

            //Select Model
            //model = new Model("house");
            model = new Model("skull");

            //Set buffers to hold position data
            vbuffer = model.SetBuffer();

            //Find size of model to be used  in camera positioning
            model.computeModelDimensions();

            //Set Light Vector
            light = new Light(model.centerX-model.diagonal*1.5f, model.centerY+model.diagonal*1.5f, 0);
            Console.WriteLine (light.light.X + " " + light.light.Y + " " + light.light.Z);
            stopwatch = new Stopwatch();
            stopwatch.Start();

            //Required to render model without holes
            graphics.Enable (EnableMode.DepthTest);
            graphics.Enable(EnableMode.CullFace);
            graphics.SetCullFace(CullFaceMode.Front, CullFaceDirection.Cw);

            return true;
        }
开发者ID:kibblebits,项目名称:TriangleSample,代码行数:53,代码来源:TriangleSample.cs

示例2: setPolygonMode

        private void setPolygonMode( GraphicsContext graphics, BasicMaterial material )
        {
            graphics.SetBlendFunc( (BlendFuncMode)material.BlendFuncMode,
                               (BlendFuncFactor)material.SrcBlendFactor,
                               (BlendFuncFactor)material.DstBlendFactor );
            graphics.SetPolygonOffset( material.PolyOffsetFactor / 1000.0f,
                                   material.PolyOffsetUnits / 1000.0f );

            // Depth Test
            graphics.Enable( EnableMode.DepthTest, material.DepthTest != 0 );
            graphics.SetDepthFunc( (DepthFuncMode)material.DepthMode, material.DepthWrite != 0 );

            graphics.Enable( EnableMode.CullFace, (CullFaceMode)material.CullFaceMode != CullFaceMode.None);
            graphics.SetCullFace( (CullFaceMode)material.CullFaceMode,
                              (CullFaceDirection)material.CullFaceDirection );
        }
开发者ID:hatano0x06,项目名称:Coroppoxus,代码行数:16,代码来源:BasicModel+(2).cs


注:本文中的GraphicsContext.SetCullFace方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。