I've been trying for some time to get a working type to handle spline movement. Basically I have been trying to have a spline type object that will take a two dimensional array of x and y values. It should have a function that would return the x and y value given a float "t" value ranging from 0 to 1. My problem is understanding how to compute the x and y values given "t". I think the spline I need is a cubic spline because the path must go through all control points.
If anyone has a type for the job that takes a two dimensional array of x,y values and could return the x and y values for a given time I would be grateful. I'm not progressing as quickly as I should in math, I'm just a hobbyist programmer. I did manage to find a class for splines in the code section of the forum but it has many arrays that I don't know the function of. Basically I just need somthing that takes a 2d array of x and y values and spits out the x and y positions for a given time between 1 and 0.
If anyone has a type for the job that takes a two dimensional array of x,y values and could return the x and y values for a given time I would be grateful. I'm not progressing as quickly as I should in math, I'm just a hobbyist programmer. I did manage to find a class for splines in the code section of the forum but it has many arrays that I don't know the function of. Basically I just need somthing that takes a 2d array of x and y values and spits out the x and y positions for a given time between 1 and 0.