Click here to Skip to main content
14,979,362 members
Articles / Desktop Programming / MFC
Posted 1 Oct 2000


44 bookmarked

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

Rate me:
Please Sign up or sign in to vote.
3.47/5 (17 votes)
1 Oct 2000
This sample teaches you how to create an OpenGL based Spline Drawing application
  • Download source files - 43 Kb
  • Sample Image - MFCSpline.gif


    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.


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

    Notes & Credits:

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


    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


    About the Author

    Masoud Samimi
    Technical Lead Samimi Information Technology
    United Arab Emirates United Arab Emirates
    My company provides services in the fields of:

    LAN/WAN Networking
    Data Management and Security
    Data Recovery
    ERP/CRM Solutions
    IT Infrastructure Solutions
    Software/Hardware Sales/Service

    Comments and Discussions

    GeneralThis is copied from... Pin
    JohnSmithTheSecond14-May-09 10:02
    MemberJohnSmithTheSecond14-May-09 10:02 
    QuestionHow to run 2 different(or same) OpenGL objects in one DialogBox? Pin
    werter13-May-04 21:21
    Memberwerter13-May-04 21:21 
    QuestionSplines? Pin
    alex.barylski30-Oct-03 20:41
    Memberalex.barylski30-Oct-03 20:41 
    Generalanomaly in click-n-drag Pin
    Anonymous4-Apr-03 13:54
    MemberAnonymous4-Apr-03 13:54 
    GeneralRe: anomaly in click-n-drag Pin
    Sickboy18-Oct-03 7:33
    MemberSickboy18-Oct-03 7:33 
    QuestionWTF? Pin
    Anonymous1-Apr-03 13:01
    MemberAnonymous1-Apr-03 13:01 
    AnswerRe: WTF? Pin
    Anonymous1-Nov-03 1:09
    MemberAnonymous1-Nov-03 1:09 

    General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

    Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.