Original Post
I am currently working on a cloth simulation projects where i have a mass spring system set up and i currently have RK4 as my integration method, i am trying to set up Verlet so that i can compare them for my project. but I'm having a bit of difficulty! I am in the understanding that i need to use the velocity verlet method, here is the maths i am using: x(t+h) = x(t) + v(t)h + (1/2)a(t)h^2 t = current time h = timestep (dt) x = position v = velocity a = (1/mass)force //the force is produced from my spring system, RK4 works fine form this force = (0,-9.8,0) //gravity for each spring connected force -= (SpringTension*direction) but its the velocity that is messing me up! how do i find v(t)? reading the Time corrected verlet method posted on this site, I'm having trouble implementing that as well x(t+h) = x(t) + (x(t) - x(t-h)) + ah^2 its the (x(t)-x(t-h)) part, am i supposed to store the current position and the previous position for each point? the subtract one from the other to give me the difference? but where does velocity come into that? I'll go sit in the corner with my confused cap on for a while :) Thanks for looking!