public override void Draw(OpenGL gl) { // Do pre drawing stuff. if (DoPreDraw(gl)) { base.Draw(gl); // Set our line settings. lineSettings.Set(gl); // Begin drawing a NURBS curve. gl.BeginCurve(nurbsRenderer); // Draw the curve. gl.NurbsCurve(nurbsRenderer, // The internal nurbs object. knots.Length, // Number of knots. knots, // The knots themselves. 3, // The size of a vertex. controlPoints.ToFloatArray(), // The control points. controlPoints.Width, // The order, i.e degree + 1. OpenGL.MAP1_VERTEX_3); // Type of data to generate. // End the curve. gl.EndCurve(nurbsRenderer); // Draw the control points. controlPoints.Draw(gl, drawPoints, drawLines); // Restore the line attributes. lineSettings.Restore(gl); // Do post drawing stuff. DoPostDraw(gl); } }
public static void Draw(IntPtr theNurb, OpenGL gl, int i, int j) { //IntPtr theNurb = gl.NewNurbsRenderer(); gl.BeginCurve(theNurb); gl.NurbsCurve(theNurb, NURBS.n + NURBS.k + 2, NURBS.u0, 3, Circle_sum.circles[i, j].controlC, 4, OpenGL.GL_MAP1_VERTEX_3); gl.EndCurve(theNurb); theNurb = IntPtr.Zero; }
/// <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, Core.RenderMode renderMode) { // Call the base. base.Render(gl, renderMode); // Begin drawing a NURBS curve. gl.BeginCurve(nurbsRenderer); // Draw the curve. gl.NurbsCurve(nurbsRenderer, // The internal nurbs object. knots.Length, // Number of knots. knots, // The knots themselves. 3, // The size of a vertex. ControlPoints.ToFloatArray(), // The control points. ControlPoints.Width, // The order, i.e degree + 1. OpenGL.GL_MAP1_VERTEX_3); // Type of data to generate. // End the curve. gl.EndCurve(nurbsRenderer); // Draw the control points. ControlPoints.Draw(gl, DrawControlPoints, DrawControlGrid); }