public void DrawSphere(SphereCollisionPrimitive primitive, Color color) { var sphere = new SphereXna() { Position = primitive.Center(), Radius = primitive.Radius(), }; var renderParam = new WireSphereRenderParameter() { Color = color, }; RenderManager.RenderSphere(sphere, renderParam); }
public void Render(SphereXna sphere) { }
public void Render(SphereXna sphere) { var scaleMat = Matrix.CreateScale(sphere.Radius); var transMat = Matrix.CreateTranslation(sphere.Position); BasicEffect.World = MathUtilXna.ToXnaMatrix(scaleMat * transMat); foreach (EffectPass pass in BasicEffect.CurrentTechnique.Passes) { pass.Apply(); for (var i = 0; i < 11; ++i) { GraphicsDevice.DrawUserIndexedPrimitives<VertexPositionColor>(PrimitiveType.LineStrip, Vertices, 0, Vertices.Length, Indices, i * 13, 12); } } }