Gamestudio Links
Zorro Links
Newest Posts
Purchase A8 full licence version
by ukgamer. 04/29/26 18:09
Z9 getting Error 058
by k_ivan. 04/25/26 19:13
ZorroGPT
by TipmyPip. 04/25/26 16:09
Stooq now requires an API key
by jcl. 04/13/26 09:42
Strange "Alien" Skull created with >Knubber<
by NeoDumont. 04/10/26 18:58
AUM Magazine
Latest Screens
Dorifto samurai
Shadow 2
Rocker`s Revenge
Stug 3 Stormartillery
Who's Online Now
0 registered members (), 4,296 guests, and 26 spiders.
Key: Admin, Global Mod, Mod
Newest Members
ukgamer, valino, juergenwue, VladMak, Geir
19210 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Page 1 of 2 1 2
Torque to Degree of Rotation #66916
03/17/06 21:37
03/17/06 21:37
Joined: Mar 2003
Posts: 4,427
Japan
A
A.Russell Offline OP
Expert
A.Russell  Offline OP
Expert
A

Joined: Mar 2003
Posts: 4,427
Japan
This is a general physics question.

If Torque = AppliedForce * DistanceFromPointWhereForceIsApplied then how do you use this figure to determin how much to rotate an object? (in degrees per tick)


For example:


Last edited by A.Russell; 03/17/06 21:40.
Re: Torque to Degree of Rotation [Re: A.Russell] #66917
03/18/06 17:29
03/18/06 17:29
Joined: Jan 2004
Posts: 2,062
Hamburg, Germany
slacer Offline
Expert
slacer  Offline
Expert

Joined: Jan 2004
Posts: 2,062
Hamburg, Germany
Hi Alex,

if you only apply the torque force once to your object, it is like a single impulse and you might not get the result you need.
This is not an answer to your question but you need to apply the force over time (several frames).

If you and a few friends try to push a car until it runs, you need to apply your forces more than just a second to make the care move...

It is the same with GameStudio Physics.

Say you apply a force of 500 to an object with a mass of 10.
If you have a very high frame rate, the force is applied for just one frame and has less effect to your object as it would have if you had a low frame rate.

Your solution has to take this into account.

My solution was to lower the force and to apply it for several frames.
Dougs hint helped me in that case.

-- slacer

Re: Torque to Degree of Rotation [Re: slacer] #66918
03/20/06 04:07
03/20/06 04:07
Joined: Mar 2003
Posts: 4,427
Japan
A
A.Russell Offline OP
Expert
A.Russell  Offline OP
Expert
A

Joined: Mar 2003
Posts: 4,427
Japan
Thanks, but not quite the answer I was looking for. I am not using Newton or 3DGS physics in this case, so I need to know how to translate the torque force into rotational movement (would you still call it velocity when it is rotational?).

No doubt the mass will affect it and the amount of time the torque is applied would add to amount the thing rotates, otherwise I could send the Earth off its orbit when I sneeze, but what is the formula? (just the basic formula without any other forces will do)






Last edited by A.Russell; 03/20/06 10:57.
Re: Torque to Degree of Rotation [Re: A.Russell] #66919
03/20/06 05:38
03/20/06 05:38
Joined: Mar 2003
Posts: 4,427
Japan
A
A.Russell Offline OP
Expert
A.Russell  Offline OP
Expert
A

Joined: Mar 2003
Posts: 4,427
Japan
I did find this:

Quote:

rot. a = torque / I, or
torque = I*(rot. a)




(the distribution of mass affects I, so let's just say the mass is equally distributed)

So in my example,

rot.a = 500/10

so,

rot.a = 50 degrees per tick added to the rotational velocity.

Is that right?

Last edited by A.Russell; 03/20/06 05:41.
Re: Torque to Degree of Rotation [Re: A.Russell] #66920
03/22/06 20:49
03/22/06 20:49
Joined: Jan 2004
Posts: 2,062
Hamburg, Germany
slacer Offline
Expert
slacer  Offline
Expert

Joined: Jan 2004
Posts: 2,062
Hamburg, Germany
Quote:

(would you still call it velocity when it is rotational?).



It is called angular velocity.

Maybe this link helps you a bit.

http://en.wikibooks.org/wiki/Torque_and_Circular_Motion_(Physics_Study_Guide)

-- slacer

Re: Torque to Degree of Rotation [Re: slacer] #66921
03/23/06 18:18
03/23/06 18:18
Joined: Mar 2003
Posts: 4,427
Japan
A
A.Russell Offline OP
Expert
A.Russell  Offline OP
Expert
A

Joined: Mar 2003
Posts: 4,427
Japan
Thanks Slacer, but I'm still not there.

From my previous formula, rot.a should be in rad/s square. However, doing a converion from radians to degrees I got results in the thousands, so that can't be right. Also, the formula doesn't work the way I'm reading it because the further from the centre the object is struck the more it will rotate, which is wrong.

Re: Torque to Degree of Rotation [Re: A.Russell] #66922
03/23/06 18:59
03/23/06 18:59
Joined: Mar 2003
Posts: 4,427
Japan
A
A.Russell Offline OP
Expert
A.Russell  Offline OP
Expert
A

Joined: Mar 2003
Posts: 4,427
Japan
Try Again:

10 quants per meter
16 ticks per second


An object of 9 meters diameter, weighing 5600kg crahes into another object of the same
size and weight going at 10m/s. The impact applies angular velocity at 5 meters from
its centre.

(moment of inertia) I = kg * m^2

I'm just going to calcualte everything as if it was perfectly spherical rather than
attempt to calculate the volume of each object (unless anyone
here has an algorithm to do that)


Torque = force (mass * velocity) 5600 * 10 X Distance 5 = 280000

I = 5600 * 9^2 = 453600


rot.a = 280000/453600 = 0.61728

radians to degrees = 35.37 degrees per second

Which would be 2.21 degrees per tick


Do I get a cigar?

Re: Torque to Degree of Rotation [Re: A.Russell] #66923
03/31/06 15:50
03/31/06 15:50
Joined: Aug 2002
Posts: 681
Massachusetts, USA
Ichiro Offline
User
Ichiro  Offline
User

Joined: Aug 2002
Posts: 681
Massachusetts, USA
You may have already considered this, but your diagram suggests a collision (of a point mass with a spherical mass) that's perfectly tangent to the surface of the sphere. While the elastic point-mass/spherical-mass model portion of the model is a good approximation (I think it does make sense to model Entity A as a sphere and Entity B as a point), shouldn't you also include a factor for the angle of incidence (theta, below), as it's likely that Entity B is likely to strike Entity A at a non-90-degree angle?



For a collision that's not perfectly tangential to the sphere, your angular momentum transfer will be less (and the linear momentum transfer greater), so the actual momentum transfer will occur more like...

angular_momentum_change = your_angular_formula * sin(theta)
linear_momentum_change = your_linear_formula * cos(theta)

...so that in a head-on collision, there's no change in angular momentum (it's all linear), whereas in a tangential collision, there's no change in linear momentum (it's all angular).

So, none of that actually answers your question, and only makes your life harder, but it may help in the long-run(?)


Dejobaan Games - Bringing you quality video games for over 75 years.
Re: Torque to Degree of Rotation [Re: Ichiro] #66924
04/01/06 01:16
04/01/06 01:16
Joined: Mar 2003
Posts: 4,427
Japan
A
A.Russell Offline OP
Expert
A.Russell  Offline OP
Expert
A

Joined: Mar 2003
Posts: 4,427
Japan
Thank you Ichiro! My example above was only to try work out how to convert torque into a tangible method of applying rotation to an object. Therefore, I tried to make it as simple as possible (90 degree strike).

I was going to use a complicated method of vetor calculations to get the amount of force to apply depending on the angle. Your simple formulas have saved me a lot of messing around!

Re: Torque to Degree of Rotation [Re: A.Russell] #66925
04/02/06 15:48
04/02/06 15:48
Joined: Mar 2003
Posts: 4,427
Japan
A
A.Russell Offline OP
Expert
A.Russell  Offline OP
Expert
A

Joined: Mar 2003
Posts: 4,427
Japan
Ahem, no cigar.

At the moment I have it set up to calcualte for stationary objects only. The linear force is fine, and behaves well.

However, it get's too much angular force and always spins to the left.

I wonder if I got this part of the formula correct:

//(moment of inertia) I = kg * m^2
moment_of_inertia = my.mass * pow(my.diameter,2);

What is "m"? I thought it would be the diameter, but I was only guessing because "rotational inertia (measured by mass and the distribution of mass), I" though I don't really understand well.


Here is the whole mess:


Code:


var test_var;
var test_var2;

var force[3];
var temp_force[3];
var moment_of_inertia;
var torque[3];
var rot_a[3];
var distance_from_centre;
var angular_force[3];
var dot_product;

function collision_event()
{

if( (event_type == event_entity) && my.push >= you.push)
{


// spaceship_event_hit+=1;
// if(spaceship_event_hit == 1)
// {

//calculate the impact force
//force = mass * velocity
force = my.mass * vec_length(my.velocity);

//adjust that by the angle of the strike
//compare the struck surface normal to the direction traveling
//start with the dot product of the two vectors
vec_set(temp, NORMAL);
vec_set(temp2, my.DRIFT_VECTOR);
if(temp || temp2) //no dividing by zero
{
dot_product = acos(vec_dot(temp.x,temp2.x)/(vec_length(temp.x)*vec_length(temp2.x)));
}

//for collision with stationary objects
force = force * (cos(180 - dot_product));


test_var = force;


//linear change
//make it bounce
vec_to_angle(temp,bounce);
temp2.x = vec_length(my.velocity);
temp2.y = 0;
temp2.z = 0;

vec_scale(temp2,0.6); //bouncyness


vec_rotate(temp2,temp);
vec_set(my.drift_vector,temp2);


//********THIS IS THE DIFFICULT BIT************************************************************************
//we also want it to change angular velocity
//check position of strike against velocity

//for collision with stationary objects

//(moment of inertia) I = kg * m^2
moment_of_inertia = my.mass * pow(my.diameter,2);

//distance_from_centre
vec_diff(temp, my.x, target);
distance_from_centre = vec_length(temp);

//Force
vec_set(temp, my.velocity);
vec_scale(temp, my.mass);
vec_set(force, temp);



//torque = force * distance_from_centre;

vec_set(temp, force);
vec_scale(temp, distance_from_centre);
vec_set(torque,temp);



//rot. a = torque / I, or
//torque = I*(rot. a)

//rot_a = torque/moment_of_inertia

if(moment_of_inertia) //don't divide by zero
{
rot_a.pan = torque.pan / moment_of_inertia;
rot_a.tilt = torque.tilt / moment_of_inertia;
rot_a.roll = torque.roll / moment_of_inertia;
}


//convert from radians to degrees
vec_set(temp,rot_a);
vec_scale(temp, 57.296);
vec_set(angular_force,temp);



//angular_momentum_change = your_angular_formula * sin(theta)
vec_scale(angular_force, sin(180 - dot_product));

//phew! Now add that to the ship's angular velocity
vec_add(my.ROT_VELOCITY, angular_force);




// }
}



Page 1 of 2 1 2

Moderated by  HeelX, Spirit 

Gamestudio download | Zorro platform | shop | Data Protection Policy

oP group Germany GmbH | Birkenstr. 25-27 | 63549 Ronneburg / Germany | info (at) opgroup.de

Powered by UBB.threads™ PHP Forum Software 7.7.1