Page 1 of 2

Bézier Curve - Getting back!

Posted: Sun Aug 05, 2012 8:47 am
by Anickyan
Hello folks! I just made a quick demo, to get back into LÖVE scripting. It is just a simple Cubic Bézier Curve, with points that can be moved. I hope you like it.

I based it off of this page: http://en.wikipedia.org/wiki/B%C3%A9zier_curve

In order to move the points, just click and drag them to wherever you want.

- Anickyan

Re: Bézier Curve - Getting back!

Posted: Sun Aug 05, 2012 3:21 pm
by Germanunkol
Very nice!
I like bezier curves :D

Have you thought about softening the edges somehow?
Are you using it for anything?

Re: Bézier Curve - Getting back!

Posted: Sun Aug 05, 2012 6:38 pm
by Anickyan
Germanunkol wrote:Very nice!
I like bezier curves :D

Have you thought about softening the edges somehow?
Are you using it for anything?
I can't really see any use for it right now, but it might be useful when I continue Android Development(Still waiting for my device :| ). I imagine some way of making an object or entity use it as a path or something.

And thank you!

Re: Bézier Curve - Getting back!

Posted: Sun Aug 05, 2012 7:13 pm
by Germanunkol
The coolest use of Beziers I've ever seen is in blender's node-based post-processing editor: http://www.freewebs.com/pwnage303/screens/bloom_DOF.jpg
Very intuitive and fun to use.

Re: Bézier Curve - Getting back!

Posted: Sun Aug 05, 2012 8:22 pm
by Ref
Anickyan wrote: Hello folks! I just made a quick demo, to get back into LÖVE scripting. It is just a simple Cubic Bézier Curve, with points that can be moved. I hope you like it.
I based it off of this page: http://en.wikipedia.org/wiki/B%C3%A9zier_curve
In order to move the points, just click and drag them to wherever you want.
- Anickyan
Did you look at the FPS?

Code: Select all

for t = 0, 1, 1 / (highest - lowest) do
When the first point is far from the last point the FPS goes way down ( something like 5fps on my computer)!
If you actually want to use a Bezier curve fit, you might want to try the function in the attached Love file.
Just a suggestion.
Best

Re: Bézier Curve - Getting back!

Posted: Sun Aug 05, 2012 10:29 pm
by Ref
Anickyan wrote: I can't really see any use for it right now, but it might be useful when I continue Android Development(Still waiting for my device :| ). I imagine some way of making an object or entity use it as a path or something.
And thank you!
You might want to consider cubic spline fitting.
Has the advantage that input data points not limited to multiples of four and curve goes through all the points provided.
Not to say thatit doesn't do some wild things on some occasions.

Re: Bézier Curve - Getting back!

Posted: Mon Aug 06, 2012 7:11 am
by Anickyan
Germanunkol wrote:The coolest use of Beziers I've ever seen is in blender's node-based post-processing editor: http://www.freewebs.com/pwnage303/screens/bloom_DOF.jpg
Very intuitive and fun to use.
Yeah, I actually used that. It looked cool!

Re: Bézier Curve - Getting back!

Posted: Mon Aug 06, 2012 7:13 am
by Anickyan
Ref wrote:
Anickyan wrote: Hello folks! I just made a quick demo, to get back into LÖVE scripting. It is just a simple Cubic Bézier Curve, with points that can be moved. I hope you like it.
I based it off of this page: http://en.wikipedia.org/wiki/B%C3%A9zier_curve
In order to move the points, just click and drag them to wherever you want.
- Anickyan
Did you look at the FPS?

Code: Select all

for t = 0, 1, 1 / (highest - lowest) do
When the first point is far from the last point the FPS goes way down ( something like 5fps on my computer)!
If you actually want to use a Bezier curve fit, you might want to try the function in the attached Love file.
Just a suggestion.
Best
I have had no problems regarding FPS, on my machine it stays at ~320 on Windows, and ~75 on Ubuntu.

Re: Bézier Curve - Getting back!

Posted: Mon Aug 06, 2012 1:29 pm
by Ref
I have had no problems regarding FPS, on my machine it stays at ~320 on Windows, and ~75 on Ubuntu.
Hmm! That's interesting as I get between 5 - 12 FPS depending on how far the end points are separated using your file.
With my bezier_spline file, I get 320 FPS constant drawing both the bezier & cubic spline curves.
But I only have a hand-cranked dual core (windows 7 - 2.1GHz) machine.
Anyone else seen this?

Re: Bézier Curve - Getting back!

Posted: Mon Aug 06, 2012 1:59 pm
by Anickyan
Ref wrote:
I have had no problems regarding FPS, on my machine it stays at ~320 on Windows, and ~75 on Ubuntu.
Hmm! That's interesting as I get between 5 - 12 FPS depending on how far the end points are separated using your file.
With my bezier_spline file, I get 320 FPS constant drawing both the bezier & cubic spline curves.
But I only have a hand-cranked dual core (windows 7 - 2.1GHz) machine.
Anyone else seen this?
I have a Windows 7(64 bit) system running on a 2.1 GHz dual-core(width 4 threads - super-threading).