2 registered members (AndrewAMD, alibaba),
1,426
guests, and 9
spiders. |
Key:
Admin,
Global Mod,
Mod
|
|
|
Re: Fluid Dynamics for lower editions
[Re: VeT]
#277320
07/08/09 20:02
07/08/09 20:02
|
Joined: Feb 2008
Posts: 3,232 Australia
EvilSOB
Expert
|
Expert
Joined: Feb 2008
Posts: 3,232
Australia
|
Gack! Brain melting... I think I'll have to sleep on this one. I just know Im going to have nightmares about three-dimensional arrays drifting through time. With any luck I'll wake up with an answer.
If I keep going round in circles like this, Im going to disappear up my own algorithm.
"There is no fate but what WE make." - CEO Cyberdyne Systems Corp. A8.30.5 Commercial
|
|
|
Re: Fluid Dynamics for lower editions
[Re: VeT]
#277325
07/08/09 20:26
07/08/09 20:26
|
Joined: Feb 2008
Posts: 3,232 Australia
EvilSOB
Expert
|
Expert
Joined: Feb 2008
Posts: 3,232
Australia
|
Just trying to get the DAMNED thing to be frame-rate independant. I cant seem to find a balanced way to put in time_step or time_frame. Either it goes too slow, and if you increase the speed the waves increase in size expotentially, Or the waves propagation is nearly non-existant, and fade to nothing before hitting the walls.
The core algorithm is just so finely tuned, and the documentation its based on is rather vague in regards to timing, hell, it doesnt really mention timing at all.
PS: The core loop of the "fluid_action" code Im working with is still the same as my last code-post.
Last edited by EvilSOB; 07/08/09 20:28. Reason: update.
"There is no fate but what WE make." - CEO Cyberdyne Systems Corp. A8.30.5 Commercial
|
|
|
Re: Fluid Dynamics for lower editions
[Re: the_mehmaster]
#277408
07/09/09 08:13
07/09/09 08:13
|
Joined: Jun 2006
Posts: 2,640 Earth
Germanunkol
Expert
|
Expert
Joined: Jun 2006
Posts: 2,640
Earth
|
I still think you should use sin curves. In physics class, to show/define waves, you use sin curves, even (or especially) for water-waves. it would be something like:
var startTime; //set this at the total_ticks value when the wave is started VECTOR* startpos; //set this to the position of the var waveSpeed = 1; //(speed of propagation? is that what you call it?) var myDistance; //distance from this vertex to startpos (with vec_dist) while((total_ticks-startTime)*waveSpeed < myDistance)wait(1); //wait until the wave has reached this vertex. startTime = total_ticks; //now start time is the time at which it starts to move my_vertex_height = max_height*sin(2*Pi*(total_ticks-startTime)/waveSpeed);
max_height would need to decrease, of course.
Also, this is (obviously, it's only for one vertex) just pseudo-code, but something like this could work for making it fps independent, because the wave would spread at an even rate. There must be a reason why physicist use sin functions for waves.
[edit] tested the fluidsimdemo1. It's much better, and the pullling with your mouse to get the effect idea was a very good one! When clicking on one of the vertecies on the edge it doesn't come back down though, and, as Vet said, it's still not FPS independent, making it "jitter" much too fast on faster computers.
Last edited by Germanunkol; 07/09/09 08:16.
~"I never let school interfere with my education"~ -Mark Twain
|
|
|
|