|
| 04 Sep 2015 09:56 AM |
Anyone know of any good sources (preferably lua) to show the path of trajectory of an object?
And this bird you cannot change. |
|
|
| Report Abuse |
|
|
|
| 04 Sep 2015 10:08 AM |
| Verlet integration will probably be exactly what you need. |
|
|
| Report Abuse |
|
|
RoflBread
|
  |
| Joined: 18 Jun 2009 |
| Total Posts: 3803 |
|
|
| 04 Sep 2015 10:50 AM |
You can use the kinematic equations to calculate where an object will be at a certain time given an initial velocity and acceleration. Works fine for Roblox. You could combine that with stepped raycasting to get an accurate representation of a simple trajectory and where it will hit something.
https://upload.wikimedia.org/math/4/3/6/436357594271ec28379aa9b0e6342b5a.png
google for more info on those if it sounds appealing.
I used to have a module which used that very method to display a parts trajectory, but I've seem to have lost that since switching to a new computer. It would have been pretty convenient to show you :-(( |
|
|
| Report Abuse |
|
|
|
| 04 Sep 2015 10:50 AM |
@Rofl
I'm terrible at those kind of equations unless I'm told which letter is what.
And this bird you cannot change. |
|
|
| Report Abuse |
|
|
RoflBread
|
  |
| Joined: 18 Jun 2009 |
| Total Posts: 3803 |
|
|
| 04 Sep 2015 11:03 AM |
U = initial velocity V = final velocity S = displacement from its starting position A = the constant acceleration of the object, which is likely to just be gravity T = time
Every variable should be assumed a vector barring time. |
|
|
| Report Abuse |
|
|
|
| 04 Sep 2015 11:06 AM |
v = u + (a*t) s = (u*t) + 2/(a*t)^2 s = 2/(u + u)*t
v2 = u^2 + 2^(a*s)
s = u*t - 2/(a*t)^2
from my basic understanding, this is correct?
And this bird you cannot change. |
|
|
| Report Abuse |
|
|
RoflBread
|
  |
| Joined: 18 Jun 2009 |
| Total Posts: 3803 |
|
|
| 04 Sep 2015 11:20 AM |
Almost -
v = u + (a*t) s = (u*t) + 0.5*(a*t)^2 s = 0.5*(u + v)*t v2 = u^2 + 2^(a*s) s = v*t - 0.5*(a*t)^2
You might only use a couple of those, really. I can write up a quick example of them in practice if you like. |
|
|
| Report Abuse |
|
|
badfitz67
|
  |
| Joined: 03 Jun 2010 |
| Total Posts: 13165 |
|
|
| 04 Sep 2015 11:24 AM |
so what I do I do with it?
And this bird you cannot change. |
|
|
| Report Abuse |
|
|
RoflBread
|
  |
| Joined: 18 Jun 2009 |
| Total Posts: 3803 |
|
|
| 04 Sep 2015 12:01 PM |
Plug in the values of the object whose path you want to track.
function PosAfterT (part, t) local startpos = part.Postion local startvel = part.Velocity local accel = Vector3.new(0,-196.2,0) return startpos + startvel * t + 0.5 * accel^2 end
You could use a loop to recalculate with slight increments of time to draw the path it will take. |
|
|
| Report Abuse |
|
|