Isosta
|
  |
| Joined: 10 May 2015 |
| Total Posts: 14729 |
|
|
| 26 Jun 2016 05:37 AM |
styles = { Linear = {p0 = 0; v0 = 1; p1 = 1; v1 = 1}; Smooth = {p0 = 0; v0 = 0; p1 = 0; v1 = 0}; Accelerate = {p0 = 0; v0 = 0; p1 = 1; v1 = 1}; Decelerate = {p0 = 0; v0 = 1; p1 = 1; v1 = 0}; }
getAlpha = function(a, style) local i = 1 - a local p0 = styles[style]["p0"] local v0 = styles[style]["v0"] local p1 = styles[style]["p1"] local v1 = styles[style]["v1"] return p0 * i * i * i + (3 * p0 + v0) * a * i * i + (3 * p1 - v1) * a * a * i + p1 * a * a *a end Ran this for each style, and they all returned this: 0.016666666666667
print(1/60,styles['//StyleHere//'])
- Isosta |
|
|
| Report Abuse |
|
|
|
| 26 Jun 2016 05:46 AM |
| You've got some edgy code here ( ͡° ͜ʖ ͡°) |
|
|
| Report Abuse |
|
|
Isosta
|
  |
| Joined: 10 May 2015 |
| Total Posts: 14729 |
|
| |
|
|
| 26 Jun 2016 05:50 AM |
Why do you do i*i*i and a*a*a instead of (i^3)?
|
|
|
| Report Abuse |
|
|
Isosta
|
  |
| Joined: 10 May 2015 |
| Total Posts: 14729 |
|
|
| 26 Jun 2016 05:52 AM |
@gur,
irrelevant idk how to math
[6:49:22 AM] Tim Deeter: each style, like accelerate should be quad in [6:49:27 AM] Tim Deeter: decelerate quad out [6:49:37 AM] Tim Deeter: linear should return .01666666666666666666666666666666666666667 [6:49:42 AM] Tim Deeter: the others shouldn't
- Isosta |
|
|
| Report Abuse |
|
|
BanTech
|
  |
| Joined: 31 Dec 2015 |
| Total Posts: 886 |
|
|
| 26 Jun 2016 06:12 AM |
What's the point of this line: print(1/60,styles['//StyleHere//'])
That will just print 0.016666666667 followed by the memory address of the table (if it exists) |
|
|
| Report Abuse |
|
|
BanTech
|
  |
| Joined: 31 Dec 2015 |
| Total Posts: 886 |
|
|
| 26 Jun 2016 06:15 AM |
for i = 0, 1, 0.1 do print('Linear', getAlpha(i, 'Linear')) -- Works end
for i = 0, 1, 0.1 do print('Smooth', getAlpha(i, 'Smooth')) -- Does not work end
for i = 0, 1, 0.1 do print('Accelerate', getAlpha(i, 'Accelerate')) -- Works end
for i = 0, 1, 0.1 do print('Decelerate', getAlpha(i, 'Decelerate')) -- Works end |
|
|
| Report Abuse |
|
|
Isosta
|
  |
| Joined: 10 May 2015 |
| Total Posts: 14729 |
|
|
| 26 Jun 2016 06:18 AM |
omfg i didn't put it in a getAlpha function im shooting myself
- Isosta |
|
|
| Report Abuse |
|
|
|
| 26 Jun 2016 06:28 AM |
| rest in peace, brave coder ( ͡° ͜ʖ ͡°) |
|
|
| Report Abuse |
|
|