Ejemplo n.º 1
0
        public void DrawControlPoints(Rectangle screenRect)
        {
            BasicPrimitives primitive = new BasicPrimitives(DisplayManager.Instance.Game.GraphicsDevice);

            for (int i = 0; i < mCurves.Count; i++)
            {
                for (int j = 0; j < mCurves[i].Points.Length - 1; j++)
                {
                    primitive.CreateLine(translanteCoord(mCurves[i].Points[j], screenRect), translanteCoord(mCurves[i].Points[j + 1], screenRect));
                    primitive.Thickness = 2.0f;
                    primitive.Colour    = Color.Red;
                    primitive.RenderLinePrimitive(DisplayManager.Instance.SpriteBatch);
                }
            }

            for (int i = 0; i < mCurves.Count; i++)
            {
                for (int j = 0; j < mCurves[i].Points.Length; j++)
                {
                    if (j != 0 || i == 0)
                    {
                        primitive.Colour = Color.Green;
                        primitive.CreateCircle(10, 10);
                        primitive.Position = translanteCoord(new Vector2(mCurves[i].Points[j].X, mCurves[i].Points[j].Y), screenRect);
                        primitive.RenderRoundPrimitive(DisplayManager.Instance.SpriteBatch);
                    }
                }
            }
        }
Ejemplo n.º 2
0
        public void Draw(Rectangle screenRect)
        {
            BasicPrimitives primitive = new BasicPrimitives(DisplayManager.Instance.Game.GraphicsDevice);

            double t = 0.0;
            int    j = 0;

            for (double i = 0.00; (float)i < 1.0f; i += 0.001)
            {
                if ((float)(i + 0.001) <= 1.0f)
                {
                    primitive.CreateLine(translanteCoord(getPoint((float)i), screenRect), translanteCoord(getPoint((float)(i + 0.001)), screenRect));
                    primitive.Thickness = 2.0f;
                    primitive.RenderLinePrimitive(DisplayManager.Instance.SpriteBatch);
                }
            }
        }