예제 #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)
        {

        }