(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));
p1->addForce(force);
p2->addForce(force);
p3->addForce(force);
}
Anyone is aware of ready available resources for BGE/python ?
Alternatively I should browse into soft body or cloth (which is faster)?
…