Click here to Skip to main content
15,868,066 members
Articles / Desktop Programming / MFC
Article

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 124.5K   4.4K   45   7
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


    Written By
    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
    JohnSmithTheSecond14-May-09 10:02 
    QuestionHow to run 2 different(or same) OpenGL objects in one DialogBox? Pin
    werter13-May-04 21:21
    werter13-May-04 21:21 
    QuestionSplines? Pin
    alex.barylski30-Oct-03 20:41
    alex.barylski30-Oct-03 20:41 
    Generalanomaly in click-n-drag Pin
    Anonymous4-Apr-03 13:54
    Anonymous4-Apr-03 13:54 
    GeneralRe: anomaly in click-n-drag Pin
    Sickboy18-Oct-03 7:33
    Sickboy18-Oct-03 7:33 
    QuestionWTF? Pin
    Anonymous1-Apr-03 13:01
    Anonymous1-Apr-03 13:01 
    WTF?
    AnswerRe: WTF? Pin
    Anonymous1-Nov-03 1:09
    Anonymous1-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.