# real time cloth wind interaction

(Hi), I would like to play with cloth-wind interaction in real time.
I would like to make a kite simulation with BGE.

I found a couple of sites sharing knowledge on this topic:
http://cg.alexandra.dk/2009/06/02/mosegaards-cloth-simulation-coding-tutorial/
http://freespace.virgin.net/hugo.elias/models/m_cloth.htm

The way to go is :

``````VECTOR: force
VECTOR: normal
VECTOR: wind

set force vector to (0,0,0) on all points on cloth

loop through all triangles
force = unitvector(normal) * dotproduct(normal, wind)
add force to all points making up this triangle
end of loop

loop through all points on cloth
add gravity to force
add force to velocity
end of loop

``````

or in C code:

``````
void addWindForcesForTriangle(Particle *p1,Particle *p2,Particle *p3, const Vec3 direction)
{
Vec3 normal = calcTriangleNormal(p1,p2,p3);
Vec3 d = normal.normalized();
Vec3 force = normal*(d.dot(direction));
}

``````

Anyone is aware of ready available resources for BGE/python ?
Alternatively I should browse into soft body or cloth (which is faster)?

first you should focus on the physics on its own…like the wind being applied to the kite and getting it to lift up.

You could do a hack job by just getting the angle of the kite and a wind direction and then lifting up the kite a certain amount based on that angle. You could have world wind and also wind caused by you pulling the kite. (wind would just be forces applied at certain vectors).

if the kite is softbody and you apply an impulse right on the center of the kite it might make the kite fabric sorta bend like wind is hitting it so you could try doing that…not sure tho.

I think your first idea is correct.
I have found some data about kite simulation physics indeed, very complicated stuff…
I would like though to test if possible to use soft body as is in Blender applying an uniform push on all triangles composing the ‘kite’ mesh ,according to code I posted in previous post ,so no impulse right on the center of the kite , .
I wonder if the softbody structure behaves predictabily as in 4 lines power kites.