Open tvarnish opened 7 years ago
I've just thought - bezier curves may not be the most accurate solution as they don't touch all of the "assigned points".
This is a problem with this implementation, as the trails are designed to show the user where the body has been, so if the curve doesn't go through the points that the body has been to (each frame), then the trail will not be a good representation of the path that the body has followed.
Also, this is going to be more difficult in 3d.
Wow, there's actually a paper on "Modelling three-dimensional trajectories ... using Bézier curves".
Another very useful page about Bézier curves: https://pomax.github.io/bezierinfo/
Instead of using Bézier curves, interpolation might be better suited to this application: http://paulbourke.net/miscellaneous/interpolation/
Perhaps (once 4 or more frames have been generated) the 3D Hermite algorithm might be a good option.
Add the option to draw a trail behind a body showing where it has been. Use grey for the colour as this should display better than trying to use colours (render issue). May have to look into bezier curves (spline) to smooth the trail between points.