Jump to content
  • Advertisement
Sign in to follow this  
_WeirdCat_

Finding drag equation for any triangle. [solved]

This topic is 932 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

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.

 

 

Edited by WiredCat

Share this post


Link to post
Share on other sites
Advertisement
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!