Our cloth is nothing but a array of point interconnected by quads or triangles.. to calcuate the force acting due to the wind what we need to do is to really pick each and every quad or triangle and find the resultant force on it.
For finding out forces due to wind we usually consider a triangle. Since I already have a triangulated mesh it was easy. each quad is split into two triangles. So basically it was a check of whether the point lies in the edge and if it did then move on or continue to split..
once we get the triangle we find the normal to each triangle. Normal to each triangle is formed by the cross product of the two vectors connecting the three vertices together.
Then we implement this formula :
resultant force = Normal * (Dot (Normal,wind))
Dot is the dot product of the vector..
once this is done the resultant force is added to all the vertices constituting the triangle and the the final resultant is added to the force vector which affects the motion.
revno: 14
committer: sundar
branch nick: qtClothSImulation
timestamp: Thu 2009-11-26 10:49:29 +0000
message:
"Implemented the wind in the simulation.. wind forces are achieved by acquiring the resultant vector of the normal and the wind force for each of the triangle.. the model implemented is nt the best considerig the wind doesnt interact rather it inhibits a force on the cloth. the movement of the cloth in no way affects the wind force. so it is a one way force acting upon it... also changed a bit of ui. .added a few options in the additional parm tab.. .so well looks cool
So ya that is my 14th revision yayys

No comments:
Post a Comment