Exemplo n.º 1
0
        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);
        }
Exemplo n.º 2
0
        public void Render(SphereXna sphere)
        {

        }
Exemplo n.º 3
0
        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);
                }
            }
        }