-
-
Notifications
You must be signed in to change notification settings - Fork 2.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[rshapes] More spline functions #4809
Comments
Variable thickness sampling is now working as intended, as of commit 1e6332e |
@AmityWilder Those improvements are really nice but I'm afraid they are growing considerably, maybe they should be moved to a separate library... let me review them carefully... |
@raysan5 If you think it would be better, I could split this issue into two separate ones: one for the math functions and one for the draw functions. Alternatively, I could split the draw functions off entirely and move them to raylib-extras, or create my own entirely separate library for them. I believe the math functions ( // amyvec::bezier::cubic
/// A cubic Bezier slice built from a [`curve::Slices`] iterator
pub struct Cubic {
pub p0: Vector2,
pub c_in: Vector2,
pub c_out: Vector2,
pub p1: Vector2,
} which I don't think makes sense to port into Raylib. I'm in the process of rewriting the functions to use an array I will say however, in case it influences your decision, I'm thinking of further modifying the variable width draw functions so that Raylib users can specify the t-values of each thickness (e.g. |
Description
It would be helpful to have spline functions for velocity--to sample a curve's direction--and calculating bounds--for collision/rendering optimization. I think these would fit in nicely alongside the
GetSplinePoint_
functions.GetSplineVelocityLinear
GetSplineVelocityBezierQuad
GetSplineVelocityBezierCubic
GetSplineAccelerationBezierQuad
GetSplineAccelerationBezierCubic
GetSplineJoltBezierCubic
GetSplineBoundsBezierLinear
GetSplineBoundsBezierQuad
GetSplineBoundsBezierCubic
GetSplineCurvatureBezierCubic
GetSplineNearestTLinear
It might also be nice to have spline drawing with variable thickness along the curve, since this can't currently be accomplished without some pretty advanced trickery.
I have already written the code for these as part of my Raylib vector art program and thought they might be valuable for others as a contribution to Raylib.
The variable thickness one needs a little work because it doesn't translate 1:1 from object-oriented Rust directly into C (I will continue to work on that further), but it is already working pretty well as a basic calligraphic effect.
The text was updated successfully, but these errors were encountered: