Bezier curves via subdivision

BlitzMax Forums/BlitzMax Programming/Bezier curves via subdivision

Ryan Burnside(Posted 2006) [#1]
Hi,
I must admit that I don't understand bezier curves. I was told by an online contact that a bezier curve may be approximated via subdivision of the sides of a polyline. Can anyone confirm this? Maybe provide an example too if possible...


AlexO(Posted 2006) [#2]
Yes you can. It's a much easier approach to implement also. As for examples, I'm not at a computer with blitzmax to play around with it. But look up LaPlace vector and that should get your started. My graphics professor probably has some stuff still on the web regarding subdivision.

Here is one of his papers
http://anglee.org/6491/proj1/Project1Report.pdf#search=%22laplace%20vector%20jarek%22

here is a student's project illustrating the process
http://www-static.cc.gatech.edu/~lena007/cs4451/p1d.html


ImaginaryHuman(Posted 2006) [#3]
Yeah, indeed you can subdivide.

But for speed, look up `forward differencing` bezier curve routines, they are much faster.


Ryan Burnside(Posted 2006) [#4]
Ah great thanks for the information!


Ryan Burnside(Posted 2006) [#5]
Well I'm having issues with implimentation, I thought lists would be a good choice to hold data because of their flexable nature. However, when I try to save a values to a list, it acts as though it were expecting an object rather than a float. Also how do I refer to an index in a list?


AlexO(Posted 2006) [#6]
lists hold objects. They can't hold primitives. You would have to make a type that wraps around a float in order to hold it in there. Considering you would have to have atleast 2 dimensions for this to work, why not make a 2D vector class? Check the documentation on indexing into an list, it's in there.


amonite(Posted 2006) [#7]
@Ryan,
Not sure what you would like to do but
if you want to make trajectories with your splines maybe you could use Matt's spline editor :
http://www.blitzbasic.com/Community/posts.php?topic=52906

It is then not difficult to use them with a Type of your own if you want to have several objects going along the same curve.


Tachyon(Posted 2006) [#8]
Link to Matt's spline editor is dead. :(


amonite(Posted 2006) [#9]
ah, then try this one :
( hope Matt doesn't mind the direct linking )
http://www.shmup-dev.com/attachments/splinemagic.exe


ImaginaryHuman(Posted 2006) [#10]
Try this:

http://www.blitzbasic.com/codearcs/codearcs.php?code=1760