Advertisement

How do i find

Started by February 05, 2016 10:08 PM
2 comments, last by _WeirdCat_ 8 years, 7 months ago

I want to refer to this:

http://www.gamasutra.com/view/news/263237/Water_interaction_model_for_boats_in_video_games_Part_2.php

i will describe it shortly

guy uses such forces

Viscous Water Resistance - the force that acts like skin friction drag

Pressure Drag Forces - something that acting towards/outwards the hull center within each surface of the hull model,

guy uses some coefficients that i am unable to find:

FDi = -(CPD1*Vi/Vr + CPD2(Vi/Vr)^2)*SubmergedSurf*(cos(Thetai)^fp * surf_normal, if cos(Thetai)

positive
fp -> falloff power of the facing dot product,

CPD1 - linear pressure drag coeff
CPD2 - quadric pressure drag coeff


FDi = -(CSD1*Vi/Vr + CSD2(Vi/Vr)^2)*SubmergedSurf*(cos(Thetai)^fs * surf_normal, if cos(Thetai),

negative

Same as above but instead of pressure we call them suction forces

cos(thetai) is an angle between velocity and surface normal

i wonder how to determine such coefficients.

Why i cant use here drag equation with a changeable drag coeff depending on fluid velocity + surface velocity multiplied by abs(arccos(cos(thetai))) / pi to get the max value when surface is facing exactly the velocity vector

Slamming Forces - same quaestion as above why i cant just use drag equation for that.

and how to calculate a volume of that shape:

Boat_HydrostaticPressureDebugDraws.gif

i ask that becasue i have divided hull into 8 boxes that are coevering it and use their center as the hooks for forces to apply,

i divide each box by one plane (they may differ for different boxes) i cant get the image of slicing such model where everything is connected and i have different slice planes for different triangles in the hull.

more over i am not quite sure if guy uses the buoyant force at all) or may he calculates it by looping through surfaces submerged in water and applies a force pointing -surface_normal for each depending on hull vel + fluid veli

i mean depending on how deep a triangle of the hull penetrates the water it has different pressure acting on it along through its shape (lets take a mean of that) so actually pressure of water below that surface pushes it up - i would stand for that, but i dont understand the equation + guy uses Vr which is unknown. (despite 6 other coefficients that are really hard to guess)

so there should be a drag equation for that since P = F / A, its strictly related to the velcotiy of fluid + the hull triangle(surface), and force which could be found by F=ma but theres a problem how do i find a proper mass of water that hit the target, thats way out of scope when i see 1000m^3 of water hitting the boardside, yeah i could do p = m / V => m = p*V (density * volume) but how to find then a volume of it.

more over going back to my simple implementation which acts wierdo on small waves (along with a 'rough water')

theres another thing how do i find water velocity i only have a heightmap that changes i have all vertices calculated for each timestep so i could know the translation along y axis for the water but how to compute x,z velocity from that so i could apply a proper drag for each surface of the hull.

because without it i can only apply drag putting in equation ship velocity and forcing it to act in the opposite direction (of that ships vel) which gives me really bad results.

and last confusion should i add bouyancy force when i calculated pressure acting on each surface (in my understanding that should be the buoyancy force itself)

i wouldn;t even ask how to apply some of forces since i dont even have a mass for each surface...

you do know that's not really the way it really works... right?

doesn't even really strike me as close...

modeling realistic hydrodynamics - interesting.

well, its basically fluid mechanics.

first off, i'd say the entire hull should be modeled as a single object with forces acting on it, a center of interia, and all that good stuff. a proper simulation would track and model positional and rotational displacement, velocity, and acceleration.

you'll be modeling basic forces on the hull, including current, buoyancy, parasitic drag from contact with the water, and engine thrust - and gravity - the weight of the boat. similar to modeling lift, weight, thrust, drag, and crosswinds in a flight sim. if you choose to model wave forces, its the same basic idea - just another force on a rigid body - basic "rigid body kinematics" - i think that's what it was called - been a while since i took that class.

hull profile presented in the relative direction of movement will factor into forces from current and thrust, and possibly drag too. you could even get into reynolds numbers and such, but its most likely overkill

an analysis of hull shape (online or off) could determine a "cross-sectional area" factor for different directions of relative movement for use with with current and thrust calculations. this is where the normals of your hull surfaces might come into play, as well as their (projected?) size. realtime calculation would probably be overkill, with pre-calculation for a few directions (say 8 around a circle) probably being sufficient to yield good results.

buoyancy is just boat density vs water displacement, where you'll need that hull volume. this will let you calculate how much of the boat has a weight equal to the volume of water it displaces. this tells you the "resting height" of the boat in the water. form there, if the boat is higher or lower, then it will bob up or sink down, with a rubber band effect, driven by wave action, jumps and landings, etc - IE anything that moves the boat up for down from resting height on calm water.

its been a long time since i took physics, engineering mechanics - dynamics, etc. wish i could be more help.

Norm Barrows

Rockland Software Productions

"Building PC games since 1989"

rocklandsoftware.net

PLAY CAVEMAN NOW!

http://rocklandsoftware.net/beta.php

Advertisement

and how to calculate a volume of that shape:

Code for mesh volume integration by Stan Melax: http://melax.github.io/volint.html. Since his code is not much readable I copy pasted here's my version: http://pastebin.com/MBGWQhFz. Also make sure the mesh is actually not a surface. Otherwise the code will assert.

And help us help you by renaming the thread title from "How do i find" to the actual description title of this thread.

ah yes i forgot that i could integrate through surfaces to get any convex shape volume. however this would require additional slice (csg like) steps to determine the rotation parts, this will be an overkill for realtime simulation.

This topic is closed to new replies.

Advertisement