I'm trying to code a simple physics simulator in C++ but I'm stuck on the air resistance issue. Surfing the Internet I only find a drag coefficient for very basical area shapes when the air is perpendicular to the area. However, even when simulating a falling parallelepiped, I found this not sufficient to describe the motion of the falling body, as the air is not always perpendicular to each face. More precisely, I'm able to calculate the air drag on each face of the object, obtaining a 3D vector which describes the force acting on the body.However it's obvious that when such an object falls through the air, even an angular momentum is induced to the body. I'm not able to determine it.I was thinking about describing the air flow as a matrix of parallels vectors, thus obtaining a resultant force as a weighted sum of the effect of each vector hitting the body. However in this case I'm not able to determine the force of each single wind vector hitting the surfaces of the body.What is the simplest way to obtain object rotation due to air resistance? And what is the finest way?
Simulate aerodynamics of a general shape object
fluid dynamics;simulation;3d
The correct description (since you want to write something physics-based) is via the Navier-Stokes equations, but it is out of the question to solve them with any kind of accuracy in real-time at 30fps.I would imagine that a reasonable approximation is to assume that the body simply falls through air without perturbing it, but that the air induces forces on each face of the body in the following way: the perpendicular component of the air velocity vector produces a force normal to a face that you can probably get from the literature (assume a rectangular face, perpendicular flow with a velocity equal to the perpendicular component of the velocity vector); the tangential component of the air velocity induces a drag force that is parallel to the face and proportional to area of the face and whose magnitude is going to be proportional to the viscosity of air. You may need to play a bit with the two proportionality factors for the two components to make things look physical.