Click here to Skip to main content
65,938 articles
CodeProject is changing. Read more.
Articles
(untagged)

Drawing Spline Types, Tension and Control Point using OpenGL and MFC

0.00/5 (No votes)
1 Oct 2000 1  
This sample teaches you how to create an OpenGL based Spline Drawing application
  • Download source files - 43 Kb
  • Sample Image - MFCSpline.gif

    Introduction

    This sample teaches you how to create an OpenGL based Spline Drawing application using the MFC library.

    It shows how to setup 4 Control Points:

    1. Start Point
    2. End Point
    3. Tangent Start Point
    4. Tangent End Point

    User Interactions

    • Right click to load the on screen context menu.
    • Left click and drag to move the selected control point around and see its effect on the spline.
    • From the Spline menu, you can select the Type of Spline: Hermite, Cardinal or Bezier.
    • In the same menu you can change the Tension of the control points effect on the spline.
    • You can also select different control points between: Start/End points and Start/End Tangent points.

    Rquirements

    The application requires opengl32.dll for windows which can be obtained from www.opengl.org.

    Notes & Credits:

    The original source code for the Spline Drawing Application is GLUT based and I found it posted on www.planet-source-code.com, OpenGL codes link. Please check the sample.

    License

    This article has no explicit license attached to it but may contain usage terms in the article text or the download files themselves. If in doubt please contact the author via the discussion board below.

    A list of licenses authors might use can be found here