Click to See Complete Forum and Search --> : Programming Semi-random, Smooth Movement
Galen_of_Edgewood
12-21-2000, 02:34 PM
Hey all,
I am trying to figure out how to code (in Java, in case you give a flip) a function to generate a seamless, semi-random, smooth movement of nodes.
I was thinking about having a function generate a point randomly that fits within a certain radius of the node's current position and then travel to that point.
This is all fine and dandy, but I am stuck here. What path will it follow to that point and how will I generate it? The nodes are supposed to appear to move smoothly towards that point generated (they currently kinda just jitter around like kids, high off of caffine and sugar, bouncing around in a small room).
Any idea of how to generate a path from one point to another that isn't a straight line? Once the path is generated, any idea how to store it?
I'm stuck and the algorithm to do what I want is a bit beyond my current knowledge, experience, and ability.
------------------
So they are no longer two, but one. -Matthew 19:6 (NIV)
Adisharr
12-21-2000, 05:09 PM
Originally posted by Galen_of_Edgewood:
Hey all,
I am trying to figure out how to code (in Java, in case you give a flip) a function to generate a seamless, semi-random, smooth movement of nodes.
I was thinking about having a function generate a point randomly that fits within a certain radius of the node's current position and then travel to that point.
This is all fine and dandy, but I am stuck here. What path will it follow to that point and how will I generate it? The nodes are supposed to appear to move smoothly towards that point generated (they currently kinda just jitter around like kids, high off of caffine and sugar, bouncing around in a small room).
Any idea of how to generate a path from one point to another that isn't a straight line? Once the path is generated, any idea how to store it?
I'm stuck and the algorithm to do what I want is a bit beyond my current knowledge, experience, and ability.
I really don't have any experience with Java at all but maybe you could use a bezier curve to give some curvyness to the path between two points. You could sample the curve and store some points in an array and have the node move between the samples.
Think that would work? Just thinking out loud again http://www.sharkyforums.com/ubb/smile.gif
$ .02
------------------
- One time.. at band camp..
Galen_of_Edgewood
12-22-2000, 11:53 AM
Originally posted by Adisharr:
I really don't have any experience with Java at all but maybe you could use a bezier curve to give some curvyness to the path between two points. You could sample the curve and store some points in an array and have the node move between the samples.
Think that would work? Just thinking out loud again http://www.sharkyforums.com/ubb/smile.gif
$ .02
I found online a Perlin Noise function. It's a neat little function, but I haven't been able to friggin' test the program... http://www.sharkyforums.com/ubb/frown.gif
I'll look for that function that you mentioned. I like that idea.
------------------
So they are no longer two, but one. -Matthew 19:6 (NIV)
Adisharr
12-22-2000, 12:12 PM
Originally posted by Galen_of_Edgewood:
I found online a Perlin Noise function. It's a neat little function, but I haven't been able to friggin' test the program... http://www.sharkyforums.com/ubb/frown.gif
I'll look for that function that you mentioned. I like that idea.
Maybe this will help..
http://moshplant.com/direct-or/bezier/math.html
------------------
- One time.. at band camp..
Galen_of_Edgewood
12-23-2000, 02:29 PM
Originally posted by Adisharr:
Maybe this will help..
http://moshplant.com/direct-or/bezier/math.html
Thanks Adisharr, I'll mess with this after I get back to work. Have a great holiday, mon ami!
------------------
So they are no longer two, but one. -Matthew 19:6 (NIV)
Adisharr
12-25-2000, 12:57 AM
Originally posted by Galen_of_Edgewood:
Thanks Adisharr, I'll mess with this after I get back to work. Have a great holiday, mon ami!
You too bud http://www.sharkyforums.com/ubb/smile.gif
------------------
- One time.. at band camp..
CajnDave
12-31-2000, 01:12 AM
Hey Galen I know this doesn't have anything to do with you topic but I was visiting family in Houston today and hear a good joke.
Q:What is G.W's favorite city in Texas?
A:Kilgore http://www.sharkyforums.com/ubb/biggrin.gif
------------------
I am an enigma in my families gene pool.
[This message has been edited by CajnDave (edited December 31, 2000).]
Galen_of_Edgewood
12-31-2000, 10:38 AM
Originally posted by CajnDave:
Hey Galen I know this doesn't have anything to do with you topic but I was visiting family in Houston today and hear a good joke.
Q:What is G.W's favorite city in Texas?
A:Kilgore http://www.sharkyforums.com/ubb/biggrin.gif
You're right, that is off-topic. http://www.sharkyforums.com/ubb/smile.gif
Yeah, I heard that one quite some time ago. It's one that's been across Texas quite a few times.
------------------
So they are no longer two, but one. -Matthew 19:6 (NIV)
CajnDave
12-31-2000, 02:50 PM
Originally posted by Galen_of_Edgewood:
You're right, that is off-topic. http://www.sharkyforums.com/ubb/smile.gif
Yeah, I heard that one quite some time ago. It's one that's been across Texas quite a few times.
I thought as much but I figured I would give it a shot anyway. Happy New Year!
Off to Whataburger
------------------
I am an enigma in my families gene pool.