Exemplo n.º 1
0
        public void Curve( )
        {
            Setup(1);
            float[] cout       = new float[m_maxpts * 2];
            int     resolution = m_maxpts; // The number of points in the bezier curve

            m_curve = new OGL.BezierInterpolation(m_points, resolution);
            Vector2 pos = Vector2.One;

            for (int p = 0; p <= resolution; p++)
            {
                pos         = m_curve.CalculatePoint(( float )p / ( float )resolution);
                cout[p * 2] = pos.X; cout[p * 2 + 1] = pos.Y;
            }
            GetOutput(cout);
        }
Exemplo n.º 2
0
        public void Curve(float x1, float y1, float x2, float y2, float x3, float y3)
        {
            Setup(3);
            // zero
            int i = 1;

            m_points[i++] = new Vector2(x1, y1);
            m_points[i++] = new Vector2(x2, y2);
            m_points[i++] = new Vector2(x3, y3);

            float[] cout       = new float[m_maxpts * 2];
            int     resolution = m_maxpts - 1; // The number of points in the bezier curve

            m_curve = new OGL.BezierInterpolation(m_points, resolution);
            Vector2 pos = Vector2.One;

            for (int p = 0; p <= resolution; p++)
            {
                pos         = m_curve.CalculatePoint(( float )p / ( float )resolution);
                cout[p * 2] = pos.X; cout[p * 2 + 1] = pos.Y;
            }
            GetOutput(cout);
        }