Click here to Skip to main content
13,353,462 members (39,204 online)
Click here to Skip to main content
Add your own
alternative version


42 bookmarked
Posted 1 Oct 2000

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

, 1 Oct 2000
Rate this:
Please Sign up or sign in to vote.
This sample teaches you how to create an OpenGL based Spline Drawing application
<!-- Download Links -->
  • Download source files - 43 Kb
  • <!-- Article image -->

    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

    You may also be interested in...


    Comments and Discussions

    GeneralThis is copied from... Pin
    JohnSmithTheSecond14-May-09 11:02
    memberJohnSmithTheSecond14-May-09 11:02 
    This is just an 'MFC wrapper' for this program:

    [Shawn R. Hartsock's Spline program]

    If you're interested in splines, don't look at this program's 1000 lines of useless, confusion MFC. There's about 100 lines of real, useful math in the original.

    Basic structure:

    QuestionHow to run 2 different(or same) OpenGL objects in one DialogBox? Pin
    werter13-May-04 22:21
    memberwerter13-May-04 22:21 
    QuestionSplines? Pin
    Hockey30-Oct-03 21:41
    memberHockey30-Oct-03 21:41 
    Generalanomaly in click-n-drag Pin
    Anonymous4-Apr-03 14:54
    sussAnonymous4-Apr-03 14:54 
    GeneralRe: anomaly in click-n-drag Pin
    Sickboy18-Oct-03 8:33
    memberSickboy18-Oct-03 8:33 
    QuestionWTF? Pin
    Anonymous1-Apr-03 14:01
    sussAnonymous1-Apr-03 14:01 
    AnswerRe: WTF? Pin
    Anonymous1-Nov-03 2:09
    sussAnonymous1-Nov-03 2: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.

    Permalink | Advertise | Privacy | Terms of Use | Mobile
    Web01 | 2.8.180111.1 | Last Updated 2 Oct 2000
    Article Copyright 2000 by Masoud Samimi
    Everything else Copyright © CodeProject, 1999-2018
    Layout: fixed | fluid