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


C# SimpleModel.GetTextureInformation方法代码示例

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


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

示例1: LoadContent

        /// <summary>
        /// Load content for the screen.
        /// </summary>
        /// <param name="GraphicInfo"></param>
        /// <param name="factory"></param>
        /// <param name="contentManager"></param>
        protected override void LoadContent(GraphicInfo GraphicInfo, GraphicFactory factory, IContentManager contentManager)
        {
            base.LoadContent(GraphicInfo, factory, contentManager);
            {
                ///Create a simple object
                ///Geomtric Info and textures (this model automaticaly loads the texture)
                SimpleModel simpleModel = new SimpleModel(factory, "model/dude");                
                for (int i = 0; i < simpleModel.GetTextureInformation(0).Count(); i++)
                {
                    simpleModel.GetTextureInformation(0)[i].SetTexture(factory.CreateTexture2DColor(1, 1, Color.White), TextureType.DIFFUSE);
                }
                
                ///Physic info (position, rotation and scale are set here)
                GhostObject pi = new GhostObject(new Vector3(200, 10, 0), Matrix.Identity, new Vector3(4));
                ///Shader info (must be a deferred type)
                ForwardGradativeAlphaShader shader = new ForwardGradativeAlphaShader();                
                ///Material info (must be a deferred type also)
                ForwardMaterial fmaterial = new ForwardMaterial(shader);
                
                ///The object itself
                IObject obj = new IObject(fmaterial, simpleModel, pi);
                ///Add to the world
                this.World.AddObject(obj);                
            }

            {
                ///Create a simple object
                ///Geomtric Info and textures (this model automaticaly loads the texture)
                SimpleModel simpleModel = new SimpleModel(factory, "model/dude");
                //simpleModel.SetTexture(factory.CreateTexture2DColor(1,1,Color.Red), TextureType.DIFFUSE);
                ///Physic info (position, rotation and scale are set here)
                GhostObject pi = new GhostObject(new Vector3(200, 10, 0), Matrix.Identity, new Vector3(4));
                ///Shader info (must be a deferred type)
                ForwardEMTransparentShader shader = new ForwardEMTransparentShader("Textures/Cubemap");                
                ///Material info (must be a deferred type also)
                ForwardMaterial fmaterial = new ForwardMaterial(shader);                
                ///The object itself
                IObject obj = new IObject(fmaterial, simpleModel, pi);
                ///Add to the world
                this.World.AddObject(obj);                
            }

            {
                SimpleModel simpleModel = new SimpleModel(factory, "model/cenario");
                ///Physic info (position, rotation and scale are set here)
                TriangleMeshObject tmesh = new TriangleMeshObject(simpleModel, Vector3.Zero, Matrix.Identity, Vector3.One, MaterialDescription.DefaultBepuMaterial());
                ///Forward Shader (look at this shader construction for more info)
                ForwardXNABasicShader shader = new ForwardXNABasicShader();
                ///Deferred material
                ForwardMaterial fmaterial = new ForwardMaterial(shader);
                ///The object itself
                IObject obj = new IObject(fmaterial, simpleModel, tmesh);
                ///Add to the world
                //this.World.AddObject(obj);
            }

            ///add a camera
            this.World.CameraManager.AddCamera(new CameraFirstPerson(GraphicInfo));
        }
开发者ID:brunoduartec,项目名称:port-ploobsengine,代码行数:65,代码来源:StealthShaderScreen.cs


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