Advertisement

Finding drag equation for any triangle. [solved]

Started by March 05, 2016 01:26 PM
-1 comments, last by _WeirdCat_ 8 years, 11 months ago

EDIT. Seems to be solved i rotated body each frame not by velocity but by the change in velocity

i find local velocity of each element by



vec3 cog2pC = vectorAB(pos + ROTATION_MAT * CENTER_OF_GRAVITY, ACTUAL_FRAME[i].pC);
vec3 local_vel = vel + AngVel * cog2pC;
where ACTUAL_FRAME.pC is pressure center in world coord
AngVel is the angular velocity of the body
then i calculate skin and form drag,
then i apply moment like that


cog2cob_vec = vectorAB(pos + ROTATION_MAT * CENTER_OF_GRAVITY, ACTUAL_FRAME[i].pC);
ETorque = cog2cob_vec *  ( element_skin_drag + element_form_drag );
elements_torque = elements_torque + ETorque; //this is overall moment which will determine angular vel

then after looping through each element i do:



mat4 inv_rot = ROTATION_MAT;
inv_rot.Inverse();

vec3 local_torque = inv_rot * elements_torque;

vec3 EAngAcc;
EAngAcc.x = local_torque.x / Ixx;
EAngAcc.y = local_torque.y / Iyy;
EAngAcc.z = local_torque.z / Izz;

AngVel = AngVel + EAngAcc*dt;

then


vec3 vLocalAngularMoment = (EAngVel*dt)*RAD_TO_DEG; //i convert that to degrees this should give me how much i should rotate (by degrees) my object

i get inproper rotation

i think its because i use radians/ s in local velocity calculation but i need degrees / s (maybe), since my linear movement is defined by m/s

im not sure if what i am doing is correct or wrong, so i can move on with finding other bugs.

i forgot to mention that i also apply these element skin and form drag forces to linear motion.

This topic is closed to new replies.

Advertisement