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


C# Mesh.BindToPass方法代码示例

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


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

示例1: BindMesh

        public override void BindMesh(Mesh mesh, string passName)
        {
            int index = -1;
            Effect effect = effectList[0];
            foreach (Effect e in effectList)
            {
                index = e.GetPassIndexByName(passName);
                if (index >= 0)
                {
                    effect = e;
                    break;
                }
            }
            if (index < 0)
                throw new Exception("No Effect pass with name '"+passName+"' was found.");

            mesh.BindToPass(D3DDevice, effect, index);
            Geometry.Add(mesh);
        }
开发者ID:adrianj,项目名称:Direct3D-Testing,代码行数:19,代码来源:MultipleEffect3DEngine.cs

示例2: OnInitComplete

        void OnInitComplete()
        {
            engine.CameraInput.Camera.FarZ = 12000;

            heightMap = ReadHgtFile(hgtFile, MapSize);

            landscape = new Landscape();
            //landscape.SplitFunction = SplitFromHeight;
            landscape.VisibleFunction = IsTriVisible;
            landscape.FetchFunction = MapFetchFunction;
            landscape.MAP_SIZE = heightMap.GetLength(0)-1;
            landscape.NUM_PATCHES_PER_SIDE = NumPatches;
            landscape.Init();
            landscape.Scale = new Vector3(1, 0.0005f, 1);
            landscape.BindToPass(engine.D3DDevice, engine.Effect, "Terrain");
            engine.Geometry.Add(landscape);

            using (MeshFactory fact = new MeshFactory())
                person = fact.CreateSphere(0.5f, 20, 20);

            float h = GetHeightAtPoint(2.5f,2.5f);

            person.Translation = new Vector3(2.5f, h+1, 2.5f);
            person.BindToPass(engine.D3DDevice, engine.Effect, 2);
            engine.Geometry.Add(person);

            engine.D3DDevice.FillMode = SlimDX.Direct3D10.FillMode.Wireframe;

            engine.CameraInput.LookAt(new Vector3(MapSize/2, 100, 0), new Vector3(MapSize/2, 0, MapSize/2));
        }
开发者ID:adrianj,项目名称:Direct3D-Testing,代码行数:30,代码来源:TerrainTest.cs

示例3: BindMesh

 public void BindMesh(Mesh mesh, int passIndex)
 {
     if (Effect == null || D3DDevice == null)
         throw new Exception("Cannot bind mesh before initialization successful.");
     mesh.BindToPass(D3DDevice, Effect, passIndex);
     Geometry.Add(mesh);
 }
开发者ID:adrianj,项目名称:Direct3D-Testing,代码行数:7,代码来源:Direct3DEngine.cs


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