|
-
Programming Semi-random, Smooth Movement
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)
-
Master of the obvious
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 
$ .02
------------------
- One time.. at band camp..
-
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 
$ .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... 
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)
-
Master of the obvious
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... 
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..
-
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)
-
Master of the obvious
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 
------------------
- One time.. at band camp..
-
Cocodrie Shark
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 
------------------
I am an enigma in my families gene pool.
[This message has been edited by CajnDave (edited December 31, 2000).]
"The only thing necessary for the triumph of evil is for good men to do nothing. "
------------------------------------
"He that lives upon hope will die fasting."
Benjamin Franklin
-
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 
You're right, that is off-topic. 
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)
-
Cocodrie Shark
Originally posted by Galen_of_Edgewood:
You're right, that is off-topic. 
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.
"The only thing necessary for the triumph of evil is for good men to do nothing. "
------------------------------------
"He that lives upon hope will die fasting."
Benjamin Franklin
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
|