public void DrawCylinder(CylinderCollisionPrimitive primitive, Color color) { var cylinder = new CylinderXna() { Base = primitive.Base(), Radius = primitive.Radius(), Height = primitive.Height(), }; var renderParam = new WireCylinderRenderParameter() { Color = color, }; RenderManager.RenderCylinder(cylinder, renderParam); }
public void Render(CylinderXna cylinder) { var scaleMat = Matrix.CreateScale( cylinder.Radius, cylinder.Height, cylinder.Radius); var transMat = Matrix.CreateTranslation(cylinder.Base); BasicEffect.World = MathUtilXna.ToXnaMatrix(scaleMat * transMat); foreach (EffectPass pass in BasicEffect.CurrentTechnique.Passes) { pass.Apply(); GraphicsDevice.DrawUserPrimitives<VertexPositionColor>(PrimitiveType.LineStrip, Vertices, 0, CylinderDivision - 1); GraphicsDevice.DrawUserPrimitives<VertexPositionColor>(PrimitiveType.LineStrip, Vertices, CylinderDivision, CylinderDivision - 1); GraphicsDevice.DrawUserIndexedPrimitives<VertexPositionColor>(PrimitiveType.LineList, Vertices, 0, Vertices.Length, Indices, 0, CylinderDivision); } }
public void Render(CylinderXna cylinder) { }