Log inRegister an accountBrowse CSDbHelp & documentationFacts & StatisticsThe forumsAvailable RSS-feeds on CSDbSupport CSDb Commodore 64 Scene Database
You are not logged in - nap
CSDb User Forums


Forums > C64 Coding > Making smooth curve movements
2010-10-21 19:50
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....
 
2010-10-22 09:39
Soren

Registered: Dec 2001
Posts: 547
Funny thing... I used to make curves for smooth movements, manually... :-D
2010-10-22 09:43
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.
2010-10-23 02:32
SIDWAVE
Account closed

Registered: Apr 2002
Posts: 2238
Thanks all for the input.
There is enough here to get going on.
2010-10-23 06:01
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.
2010-10-23 07:30
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.
2010-10-23 12:28
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
2010-10-23 14:45
MacGyver
Account closed

Registered: Dec 2001
Posts: 149
Was a test, plz delete.
2010-10-23 22:48
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 ?
2010-10-24 05:32
Martin Piper

Registered: Nov 2007
Posts: 722
The method I described would fit what you need.
2010-10-24 08:27
Hein

Registered: Apr 2004
Posts: 954
Quote: 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 ?


erm, first you say thanks, now you say fuck you.. wassup?

You can't expect people to do the code for you, else there's nothing to explore. I think there's enough options in this thread to choose from.
Previous - 1 | 2 | 3 - Next
RefreshSubscribe to this thread:

You need to be logged in to post in the forum.

Search the forum:
Search   for   in  
All times are CET.
Search CSDb
Advanced
Users Online
Mike
Andy/AEG
kbs/Pht/Lxt
Acidchild/Padua
Alakran_64
Honcho
𝘁𝗡𝗚/FairLight
Benson/Tristar & Red..
Freeze/Blazon
blitzed
Guests online: 108
Top Demos
1 Next Level  (9.7)
2 13:37  (9.7)
3 Mojo  (9.7)
4 Coma Light 13  (9.6)
5 Edge of Disgrace  (9.6)
6 What Is The Matrix 2  (9.6)
7 The Demo Coder  (9.6)
8 Uncensored  (9.6)
9 Comaland 100%  (9.6)
10 Wonderland XIV  (9.6)
Top onefile Demos
1 No Listen  (9.6)
2 Layers  (9.6)
3 Cubic Dream  (9.6)
4 Party Elk 2  (9.6)
5 Copper Booze  (9.6)
6 Dawnfall V1.1  (9.5)
7 Rainbow Connection  (9.5)
8 Onscreen 5k  (9.5)
9 Morph  (9.5)
10 Libertongo  (9.5)
Top Groups
1 Performers  (9.3)
2 Booze Design  (9.3)
3 Oxyron  (9.3)
4 Censor Design  (9.3)
5 Triad  (9.3)
Top Fullscreen Graphicians
1 Joe  (9.7)
2 Sulevi  (9.6)
3 The Sarge  (9.6)
4 Veto  (9.6)
5 Facet  (9.6)

Home - Disclaimer
Copyright © No Name 2001-2024
Page generated in: 0.045 sec.