Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8268479
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T05:54:13+00:00 2026-06-08T05:54:13+00:00

Basically I wish to draw a curve between 3 points in openGL as the

  • 0

Basically I wish to draw a curve between 3 points in openGL as the below image indicates. I’ve found a couple of segments of code which would be useful for drawing a bezier curve using 4 points but for 3 points I’ve had really no success.

enter image description here

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-08T05:54:14+00:00Added an answer on June 8, 2026 at 5:54 am

    From the definition of a Bezier curve you have the following formula (for each x, y component):

    x(t) = (1-t)^3*p1x + 3*t*(1-t)^2*c1x + 3*t^2*(1-t)*c3x + t^3*p3x
    y(t) = (1-t)^3*p1y + 3*t*(1-t)^2*c1y + 3*t^2*(1-t)*c3y + t^3*p3y
    

    Bezier Constructions

    In your case you know the mid point (p2x,p2y). You can also assume that c1x and c2x have the same value; and that c1y and c2y also have the same value

    So we have the following equations at t=0.5

    p2x = (3/4)*c1x+(p1x+p3x)/8
    p2y = (3/4)*c1y+(p1y+p3y)/8
    

    which are solved for c1x=c2x and c1y=c2y with

    c1x = c2x = -(p1x-8*p2x+p3x)/6
    c1y = c2y = -(p1y-8*p2y+p3y)/6
    

    to give the final Bezier equation to use in terms of points (p1x,p1y), (p2x,p2y) and (p3x,p3y):

    x(t) =    (1-t)^3 *      [p1x]
         + 3*t*(1-t)^2 * [-(p1x-8*p2x+p3x)/6]
         + 3*t^2*(1-t) * [-(p1x-8*p2x+p3x)/6]
         +    t^3 *          [p3x]
    
    y(t) =    (1-t)^3 *      [p1y]
         + 3*t*(1-t)^2 * [-(p1y-8*p2y+p3y)/6]
         + 3*t^2*(1-t) * [-(p1y-8*p2y+p3y)/6]
         +    t^3 *          [p3y]
    

    Summary

    Try the four control points

    1. ( p1x, p1y )
    2. ( -(p1x-8*p2x+p3x)/6, -(p1y-8*p2y+p3y)/6 )
    3. ( -(p1x-8*p2x+p3x)/6, -(p1y-8*p2y+p3y)/6 )
    4. ( p3x, p3y )

    Here is an example I made with p1=(0,0), p2=(2,2) and p3=(4,-1). I calculated the following control points

    1. ( 0, 0 )
    2. ( 2, 17/6 )
    3. ( 2, 17/6 )
    4. ( 4, -1)

    with the results shown below:

    Derive Plot

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Hi I have this code below which basically after 25 seconds of showing the
Basically, I have a JTextPane to hold some text which I wish to style.
I have a couple of global structs in a binary which are basically tables
I am using JQuery to position a series of div tags which basically use
What I basically wish to do is design a generic interface that, when implemented,
basically i wish to achieve like user type file name,then video will be pop
I wish to do something iframe-like with my div i've got going here. Basically,
Basically I wish to use the methods of a class within the Jar file,
I wish to create a tab application in Android. I wish to basically have
I wish to output large numbers with thousand-separators (commas or spaces) — basically the

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.