Click here to Skip to main content
15,891,951 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hello.
I'd like to draw a b-spline with a
When I draw it with polybezier, I start to draw the curve strangely from when there are more than four values. I want to draw it so that it connects smoothly when there are n values. What is there? 
I want an example of a code in c++.


What I have tried:

I drew a polybezier in an array of four or more values.
Posted
Updated 18-Feb-20 16:09pm
Comments
Stefan_Lang 19-Feb-20 2:58am    
Maybe you should clarify what you want, by using concise vocabulary:
0. The first sentence is not finished
1. B-Spline and Bezier are different types (the latter is a special case of the former). Which one do you want?
2. What do you mean by 'polybezier'?
3. What 'four values' are you talking about?
4. What do you mean by 'connect smoothly'
5. What code are you using currently? You said 'I drew a polybezier', what do you mean by that?

It is very difficult to help you if you cannot express clearly what you have and where you want to go.


P.S.:
I *think-* what you mean is that you have drawn one Cubic Bezier Curve using four control points, and now you want to know how you can define/calculate/draw(?) a Piecewise Cubic Bezier Curve with curves that are tangentially joined at the ends.


1 solution

Have a look at this page : Bezier Surfaces and Lines[^] It discusses 2D and 3D splines and has source code for both.

Actually, the entire site is really, really good. I have lifted a LOT of code from it.
 
Share this answer
 
Comments
Stefan_Lang 19-Feb-20 3:01am    
Very good link. If that doesn't help, I don't know what will.
Rick York 19-Feb-20 10:44am    
Thank you. I tend to agree. ;)

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900