1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22
| public void Render(GraphicsDevice graphics, Matrix view, Matrix projection)
{
graphics.VertexDeclaration = new VertexDeclaration(graphics, VertexPositionNormalTexture.VertexElements);
//graphics.RenderState.CullMode = CullMode.None;
_effect.World = Matrix.Identity;
_effect.View = view;
_effect.Projection = projection;
_effect.Begin();
foreach (EffectPass pass in _effect.CurrentTechnique.Passes)
{
pass.Begin();
graphics.DrawUserIndexedPrimitives<VertexPositionNormalTexture>(
PrimitiveType.TriangleList,
Vertices, 0, Vertices.Length, Indexes, 0, Indexes.Length / 3);
pass.End();
}
_effect.End();
} |
Partager