PlayMaker Updates & Downloads > Share New Actions

Draw Bézier Curve Action

(1/6) > >>

holyfingers:
Hi there,

Couldn't find an action for drawing a curve anywhere so thought I'd try and put one together...



It's based on the existing Draw Line action from here: http://hutonggames.com/playmakerforum/index.php?topic=3943.0 though it doesn't have quite as many options, I might add them in later on.

The code for defining the curve comes from here: https://en.wikibooks.org/wiki/Cg_Programming/Unity/B%C3%A9zier_Curves

First attempt at making a custom action and I'm not much of a coder so let me know if there's anything that needs fixed/changed!

Cheers,

Nick

dudebxl:
cool  ;D

boragungor:
Thanks  :)

holyfingers:
Managed to get the Spline code from that page working as well, so you can now define how many points you want to use. Not quite as straightforward as before, it needs at least 5 control points and your Start point and End point need to occupy the first two and last two slots for the spline to reach the ends.



Could be a lot tidier, it would be nice to be able to set the Start and End points and just use the compound array for the Middle ones for example. I also couldn't find a way to use just one input per array item hence the empty Label strings. It seems to be working pretty well though so I'd thought I'd share it as is.

Again, let me know if there are any issues I've missed!

Cheers,

Nick

Lane:
Looks cool!

I haven't checked the code out yet but since you're still tinkering with it I thought I would drop Jasper Flick's Bezier tutorial since its got some nifty solutions in it. Might help tidy things up for you. =)

Navigation

[0] Message Index

[#] Next page

Go to full version