tvarnish / sombrero

Sombrero is my A-Level Computer Science project focusing on the simulation of the N-Body Problem
1 stars 0 forks source link

Add optional trails to bodies #5

Open tvarnish opened 7 years ago

tvarnish commented 7 years ago

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.

tvarnish commented 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.

tvarnish commented 7 years ago

Wow, there's actually a paper on "Modelling three-dimensional trajectories ... using Bézier curves".

http://mreed.umtri.umich.edu/mreed/pubs/Faraway_2007.pdf

tvarnish commented 7 years ago

Another very useful page about Bézier curves: https://pomax.github.io/bezierinfo/

tvarnish commented 7 years ago

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.