Time for action – drawing the terrain
1. In Solution Explorer, right-click on the Effects folder in the content project. Select Add | New Item....
2. In the central pane of the Add New Item window, select Effect File.
3. Name the file
Terrain.fx
and click Add.4. If you wish, browse through the
template effect
file that opens when it is added to the project, and then close the file.5. Add the
Dra
w
region to theTerrain
class:#region Draw public void Draw( ArcBallCamera camera, Effect effect) { effect.CurrentTechnique = effect.Techniques["Technique1"]; effect.Parameters["World"].SetValue(Matrix.Identity); effect.Parameters["View"].SetValue(camera.View); effect.Parameters["Projection"].SetValue(camera.Projection); foreach (EffectPass pass in effect.CurrentTechnique.Passes) { pass.Apply(); device.SetVertexBuffer(vertexBuffer); device.Indices = indexBuffer; device.DrawIndexedPrimitives( PrimitiveType.TriangleList, ...