Пример #1
0
        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);
        }
Пример #2
0
        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);
            }
        }
Пример #3
0
        public void Render(CylinderXna cylinder)
        {

        }