Exemplo n.º 1
0
        /// <summary>
        /// Render to the provided instance of OpenGL.
        /// </summary>
        /// <param name="gl">The OpenGL instance.</param>
        /// <param name="renderMode">The render mode.</param>
        public override void Render(OpenGL gl, RenderMode renderMode)
        {
            base.Render(gl, renderMode);

            //	Begin drawing a NURBS surface.
            gl.BeginSurface(nurbsRenderer);

            //	Draw the surface.
            gl.NurbsSurface(nurbsRenderer,                //	The internal nurbs object.
                            sKnots.Length,                //	Number of s-knots.
                            sKnots,                       //	The s-knots themselves.
                            tKnots.Length,                //	The number of t-knots.
                            tKnots,                       //	The t-knots themselves.
                            ControlPoints.Width * 3,      //	The size of a row of control points.
                            3,                            //	The size of a control points.
                            ControlPoints.ToFloatArray(), //	The control points.
                            ControlPoints.Width,          //	The order, i.e degree + 1.
                            ControlPoints.Height,         //	The order, i.e degree + 1.
                            OpenGL.GL_MAP2_VERTEX_3);     //	Type of data to generate.

            //	End the surface.
            gl.EndSurface(nurbsRenderer);

            //	Draw the control points.
            ControlPoints.Draw(gl, DrawControlPoints, DrawControlGrid);
        }