Skip to content
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

Various Bezier functions (both 3 point and 4 point, provided examples are for 4 point specifically) #241

Open
fan-of123 opened this issue Aug 12, 2024 · 4 comments

Comments

@fan-of123
Copy link

Bezier curves are rather underused within minecraft mapmaking and there's precious little library support for them. Despite this, they're really useful for many things including visual effects, camera paths, curved projectile arcs, and more.

Main function ideas I had were:

  • Given a start, end, two points, and a t value, find a point along a curve or the derivative at that point.
  • Given a start, end, and two points, approximate the length of a curve.
  • Given a start, end, two points for the curve to pass through and the t values at those points, calculate the control points of a curve (math for this is pretty big so having the t values be hardest to like .333/.666 or .25/.75 would simplify it a lot).
  • Given the start, end, two controls, and an amount of iterations, calculate velocity, acceleration, and jerk values to use for iterating along a curve cheaply (useful for making things like projectiles that follow set arcs but with a guaranteed target).
@theogiraudet
Copy link
Contributor

Thanks for your proposition! Can you give some uses you see for Minecraft?

@fan-of123
Copy link
Author

I'm not the most creative person, the big use I see is mostly in just making cool VFX. If you want examples, here's two effects ive done using them: https://youtu.be/ykD7muPQkD0 (4 point and 3 point beziers, respectively). I also have this clip from awhile ago that uses them for lightning: https://youtu.be/6YeJW4Yh3JI

Aside from that I can see niche uses for, as mentioned above, projectile attacks and such (most of my datapack experience is in boss/enemy/weapon design). That and camera paths, but you guys seem to already be working on a module for that.

Really, the main use is just: making cool looking things. If that's not enough of a reason to add something to your lib, then that's totally ok, just wanted to put the idea out there.

@theogiraudet
Copy link
Contributor

Thank you very much! We will see if we have time to implement that after your current tasks.
If someone else is interested in implementing this system, do not hesitate to say it here!

@aksiome
Copy link
Member

aksiome commented Aug 14, 2024

I think we should move this to a separate module, since we'll need other type of splines for the camera module. Maybe a module interpolate?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: ⏳ Todo
Development

No branches or pull requests

3 participants