OAuth2
|
  |
| Joined: 27 Nov 2016 |
| Total Posts: 751 |
|
|
| 03 Jan 2017 04:47 PM |
https://www.roblox.com/games/599805651/DrawTest
I'm just messing with guis again and I was wondering how to get the positions between 2 frames.
If you play the game and move your mouse really quick, it will "skip" a pixels.
My solution was to compare the old points vs the new point and see if they are "x" distance away, thus creating frames in between.
How exactly do I achieve this?
|
|
|
| Report Abuse |
|
|
OAuth2
|
  |
| Joined: 27 Nov 2016 |
| Total Posts: 751 |
|
|
| 03 Jan 2017 04:48 PM |
Please don't mind the grammatical errors. I haven't slept in days.
|
|
|
| Report Abuse |
|
|
kools
|
  |
| Joined: 11 Jan 2009 |
| Total Posts: 1659 |
|
|
| 03 Jan 2017 04:54 PM |
You are looking for Bresenham's line algorithm or Xiaolin Wu's line algorithm depending on how in depth you want to make your DrawingTest.
Never be afraid to rip other people's work and not re-invent in the wheel. I would search for lua interpretations of these respected algorithms and figure out how to apply it to the creation of frames. |
|
|
| Report Abuse |
|
|
OAuth2
|
  |
| Joined: 27 Nov 2016 |
| Total Posts: 751 |
|
| |
|
|
| 03 Jan 2017 06:54 PM |
| I suppose it's something like magnitude. |
|
|
| Report Abuse |
|
|
OAuth2
|
  |
| Joined: 27 Nov 2016 |
| Total Posts: 751 |
|
|
| 03 Jan 2017 07:02 PM |
HalfPinky
I just did an easy solution using recursive functions.
|
|
|
| Report Abuse |
|
|