本文整理汇总了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);
}
示例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));
}
示例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);
}