| |
SIDWAVE Account closed
Registered: Apr 2002 Posts: 2238 |
Making smooth curve movements
K, so i want to make some kinda smooth curves to move sprites along.
I know I could use specially tailored sinus data, but then i still have to code something to do the movement exactly as i want it.
So i consider to make a small movement recorder, where i move a sprite with a joystick, and record the path.
So, now comes the hard part: if i record some (as perfect as can be) movement (a path), then how could i flatten out the recorded data afterwards, so my imprefect drawn move, becomes super smooth ?
This is some math i know nothing about, anyone ? |
|
... 18 posts hidden. Click here to view all posts.... |
| |
Devia
Registered: Oct 2004 Posts: 401 |
yes, but again: how would you calculate those tables? |
| |
Slammer
Registered: Feb 2004 Posts: 416 |
Siggraph have some material on splines, but if you are not familiar with the subject I guess this stuff can be hard to read (try searching for better pages).
http://www.siggraph.org/education/materials/HyperGraph/modeling..
|
| |
Soren
Registered: Dec 2001 Posts: 547 |
Funny thing... I used to make curves for smooth movements, manually... :-D
|
| |
Mace
Registered: May 2002 Posts: 1799 |
For those smart enough, I sense the opportunity to write a stunning tool that lets you create splines in hires to create sprite move tables. |
| |
SIDWAVE Account closed
Registered: Apr 2002 Posts: 2238 |
Thanks all for the input.
There is enough here to get going on.
|
| |
Martin Piper
Registered: Nov 2007 Posts: 722 |
If you don't want to use splines or other similar code then what you can do is have the joystick alter the velocity, not the position, of a sprite. Think of it like flying a thrust ship but instead of rotation you control the thrust vectors instead. Using the C64 if you use sub pixel accurate coordinates and velocity you can manually control your smooth movement. Getting the data to loop is a simple matter of getting close enough to your ending position and then triggering a lerp over several frames to close the loop. |
| |
Radiant
Registered: Sep 2004 Posts: 639 |
Another option if you don't want to use splines would be to use GNU Octave, input pivots into a matrix, and use the polyfit() function go get a polynomial approximation of the curve. |
| |
Perplex
Registered: Feb 2009 Posts: 255 |
If you want to create a smooth curve through manually set key points, one of the common solutions is to use Catmull-Rom Splines (see Pantaloon's post for math functions).
A good introduction can be found here: http://www.cs.cmu.edu/~462/projects/assn2/assn2/catmullRom.pdf
|
| |
MacGyver Account closed
Registered: Dec 2001 Posts: 149 |
Was a test, plz delete. |
| |
SIDWAVE Account closed
Registered: Apr 2002 Posts: 2238 |
all i really want is, that when i move a sprite to record the path, the outcome becomes smooth. nomatter what kind amove i do.
if you have knowledge to code that on c64, then do.
f.ex i move diagonal up right, then hard down right, a triangle. then the tip of the triangle shouldnt be hard, it should become a small smooth curve.
get it ? |
Previous - 1 | 2 | 3 - Next |