[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

Bezier Curves with variable  No. of points?

Posted on 2000-04-27
11
Medium Priority
?
421 Views
Last Modified: 2010-04-04
To use Canvas.PolyBezier the number of points must be three times an integer plus 1. Isn't there any way to draw a bezier curve going through a variable number of points or guided by them?
0
Comment
Question by:karouri
  • 6
  • 5
11 Comments
 
LVL 3

Expert Comment

by:sburck
ID: 2754824
Each set of 4 (3) points is used to define a section of the Bezier curve.  The first 4 points define the first curve (1 & 4 are endpoints, 2 & 3 are control points).  The next three points define the next section of the curve, where the original point 4 is the starting point, the new point 3 is the new end point, and the new 1 & 2 are the new control points.  The 'variable number of points' is exactly the 'three times an integer' you mentioned above - the points numbered 1,4,7,10... which you pass to PolyBezier are points on the curve, whereas 2,3 define the curve between 1&4, 5&6 define the curve between 4&7, etc...
0
 
LVL 3

Author Comment

by:karouri
ID: 2763253
If the points I need to draw a bezier curve through are points 1,4,7,10,... then I must have two points between each point I already have.What are these points?
0
 
LVL 3

Accepted Solution

by:
sburck earned 200 total points
ID: 2763315
They are control points for the Bezier curve.  A Bezier curve is defined by endpoints and control points.  For a description of exactly what a control point is, there's a nice discussion with some Shockwave descriptions at

http://www.moshplant.com/direct-or/bezier/index.html

0
Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

 
LVL 3

Expert Comment

by:sburck
ID: 2904331
Still there?
0
 
LVL 3

Author Comment

by:karouri
ID: 2911902
Sorry,sburck.
I am still there, and my idea is exactly to draw a smooth curve that passes though a given number of points or is guided by them,like in a airline map.
The number may be anything 3,4,5,6,...
Now you see my problem, I hope there is an answer.
By the way,the site about Bezier is good,thanks.
0
 
LVL 3

Expert Comment

by:sburck
ID: 2926981
I'm still saying that that is exactly what you do with the function PolyBezier.  The endpoints (1,4),(4,7),(7,10)...(k*3+1,k*3+3) are the points you pass through, the other points direct the direction of the curve on the way through those points.
0
 
LVL 3

Author Comment

by:karouri
ID: 2927965
Say I have 8 points, now I use (1,4),(4,7) as end points,and points 2,3,5,6 as intermediary points. What about point 8. Shall I leave it out of the line?
0
 
LVL 3

Expert Comment

by:sburck
ID: 2928028
No, you're confused.  If you want to run your curve though a set of eight different points, you require a total of 22 points.  Each foursome is a set of endpoints, with two control points.  The startpoints and endpoints overlap.  So, in your exampl, your eight points are: 1,4,7,10,13,16,19 & 22.  The remain points: 2,3,5,6,8,9,11,12,14,15,17,18,20,21 are the control points where:

2 & 3 are the control points for the segment between 1 & 4.
5 & 6 are the control points for the segment between 4 & 7.
....
n & n +1 are the control points for the segment between n-1 & n+2

Your curve passes through all 8 of your points, and the control points determine the path the curve will take between the pairs of points (look at the site again, at the live control point placer, to see how to place the control points to get the curve shape you want).
0
 
LVL 3

Author Comment

by:karouri
ID: 2933919
I am beginning to get the point, I think. Though I'm a little confused about the control points. Experimenting a little with Bezier curves may give me a clue as for where to put the control points,so you will get the points. If you have any other advice,I will be thankful.
0
 
LVL 3

Expert Comment

by:sburck
ID: 2938096
Just look again at the website I pointed out - the control points are the two points off of the curve which 'pull' the curve toward them.  For example (try to do a text drawing here.

      C1
     
      ----
     /     \__       __Y
X -/          \___/

                    C2

The points C1 and C2 determine the way the curve goes up from X, down from C1 to C2, and up to Y.  If the control points were reversed, the curve would leave X going down and sharply to the right from X toward C2, draw to the left and up from C2 to C1, and then down and sharply to the right to Y, something like this:



      c2
X \        /--\
    \      /     ----- Y   (sort of, doing this in text is difficult).
      --\  |
          _|
              c1


Try it a few times at the website, you'll get a feel for it.
0
 
LVL 3

Author Comment

by:karouri
ID: 2942631
Comment accepted as answer
0

Featured Post

New feature and membership benefit!

New feature! Upgrade and increase expert visibility of your issues with Priority Questions.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Objective: - This article will help user in how to convert their numeric value become words. How to use 1. You can copy this code in your Unit as function 2. than you can perform your function by type this code The Code   (CODE) The Im…
In my programming career I have only very rarely run into situations where operator overloading would be of any use in my work.  Normally those situations involved math with either overly large numbers (hundreds of thousands of digits or accuracy re…
Exchange organizations may use the Journaling Agent of the Transport Service to archive messages going through Exchange. However, if the Transport Service is integrated with some email content management application (such as an anti-spam), the admin…
Whether it be Exchange Server Crash Issues, Dirty Shutdown Errors or Failed to mount error, Stellar Phoenix Mailbox Exchange Recovery has always got your back. With the help of its easy to understand user interface and 3 simple steps recovery proced…
Suggested Courses

834 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question