Bézier Curve - Getting back!

Showcase your libraries, tools and other projects that help your fellow love users.
Anickyan
Prole
Posts: 27
Joined: Sun Aug 05, 2012 8:42 am

Bézier Curve - Getting back!

Post 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
Attachments
bezier.love
The NEW programme.
(1.2 KiB) Downloaded 313 times
bezier.love
The programme itself.
(1.1 KiB) Downloaded 191 times
Germanunkol
Party member
Posts: 712
Joined: Fri Jun 22, 2012 4:54 pm
Contact:

Re: Bézier Curve - Getting back!

Post by Germanunkol »

Very nice!
I like bezier curves :D

Have you thought about softening the edges somehow?
Are you using it for anything?
trAInsported - Write AI to control your trains
Bandana (Dev blog) - Platformer featuring an awesome little ninja by Micha and me
GridCars - Our jam entry for LD31
Germanunkol.de
Anickyan
Prole
Posts: 27
Joined: Sun Aug 05, 2012 8:42 am

Re: Bézier Curve - Getting back!

Post 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!
Germanunkol
Party member
Posts: 712
Joined: Fri Jun 22, 2012 4:54 pm
Contact:

Re: Bézier Curve - Getting back!

Post 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.
trAInsported - Write AI to control your trains
Bandana (Dev blog) - Platformer featuring an awesome little ninja by Micha and me
GridCars - Our jam entry for LD31
Germanunkol.de
User avatar
Ref
Party member
Posts: 702
Joined: Wed May 02, 2012 11:05 pm

Re: Bézier Curve - Getting back!

Post 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
Attachments
bezier_ref.love
alternative bezier curve fit
(952 Bytes) Downloaded 188 times
User avatar
Ref
Party member
Posts: 702
Joined: Wed May 02, 2012 11:05 pm

Re: Bézier Curve - Getting back!

Post 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.
Attachments
bezier_spline.love
shows both Bezier & Cubic Spline data fits
(1.68 KiB) Downloaded 203 times
Anickyan
Prole
Posts: 27
Joined: Sun Aug 05, 2012 8:42 am

Re: Bézier Curve - Getting back!

Post 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!
Anickyan
Prole
Posts: 27
Joined: Sun Aug 05, 2012 8:42 am

Re: Bézier Curve - Getting back!

Post 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.
User avatar
Ref
Party member
Posts: 702
Joined: Wed May 02, 2012 11:05 pm

Re: Bézier Curve - Getting back!

Post 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?
Anickyan
Prole
Posts: 27
Joined: Sun Aug 05, 2012 8:42 am

Re: Bézier Curve - Getting back!

Post 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).
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest