Results 1 to 15 of 15

Thread: Cannon Shot Questions - Some Physics

  1. #1

    Thread Starter
    PowerPoster Halsafar's Avatar
    Join Date
    Jun 2004
    Location
    Saskatoon, SK
    Posts
    2,339

    Cannon Shot Questions - Some Physics

    Alright, I made a little diagram of the situation.
    Now, this is suppose to be 3D, but the screeny is a 2D Example.

    I understand the following:
    - Calculate intial Force based on the yaw of the turret and the pitch of the cannon (angle and up angle).
    - vV = vU + (vA * t); I can calculate the velocity and have it accelerate
    - vGravity += (0,-9.81,) * Mass; Apply that to the velocity vV += vGravity;

    Things I need explained:
    - How to apply wind force? is wind force a vector? how come it is always explained in a scalar? do the weather channels take the magnitude of the wind vector?

    - Will the simple accelerator and gravity application above cause the parabola effect as a cannon shot should.

    - How do I calculate the terminal velocity and apply it? as in the velocity at which an object stop gaining downward speed (right?).

    - Does wind resistance or gravity or both apply to acceleration force? or the current velocity?


    Thanks in advance,
    Halsafar
    Attached Images Attached Images  
    Last edited by Halsafar; Feb 21st, 2005 at 02:39 PM.
    "From what was there, and was meant to be, but not of that was faded away." - - Steve Damm

    "The polar opposite of nothingness is existance. When existance calls apon nothingness it shall return to nothingness." - - Steve Damm

    "When you do things right, people won't be sure if you did anything at all." - - God from Futurama

  2. #2

    Thread Starter
    PowerPoster Halsafar's Avatar
    Join Date
    Jun 2004
    Location
    Saskatoon, SK
    Posts
    2,339

    Re: Cannon Shot Questions - Some Physics

    I have the application built, now all I need are the above questions answered.

    This is a project to aid in the design of my next game. I will be posting the source and all of this physic demo probably tomorrow if I can get this sorted out today.
    "From what was there, and was meant to be, but not of that was faded away." - - Steve Damm

    "The polar opposite of nothingness is existance. When existance calls apon nothingness it shall return to nothingness." - - Steve Damm

    "When you do things right, people won't be sure if you did anything at all." - - God from Futurama

  3. #3
    type Woss is new Grumpy; wossname's Avatar
    Join Date
    Aug 2002
    Location
    #!/bin/bash
    Posts
    5,682

    Re: Cannon Shot Questions - Some Physics

    I'd just have a vector for the 4 main things...

    1. Cannonball position
    2. Cannonball velocity
    3. Gravity
    4. Wind

    Use the cannon to set the initial velocity to some large quantity (i assume you are using metres per second as your units?) with the appropriate angle. then for each time step add both the wind and gravity to your velocity (taking the mass of the projectile into account using simple acceleration laws) then simply add that resultant velocity to the position of the cannonball. That should be all there is to it.

    You might want to give the wind vector a more accurate feel by adding the [reverse of the cannonball velocity] to it. This will give a more accurate 'local windspeed'. I haven't worked out the appropriate math for that though.

    Wind resistance effect would be hardly noticable for something like a cannonball, given its large mass and small volume and surface area. Terminal velocity (due to gravity) for a cannon ball is significantly greater than that of, say, a cricket ball.

    I'll do the math now and get back in an hour or so...
    I don't live here any more.

  4. #4

    Thread Starter
    PowerPoster Halsafar's Avatar
    Join Date
    Jun 2004
    Location
    Saskatoon, SK
    Posts
    2,339

    Re: Cannon Shot Questions - Some Physics

    I figured that much myself. Applyin wind resistance to the velocity bugs me a bit tho.

    A ball will continue to accelerate at the same force, gaining velocity of course.
    Wind resistance applys only to velocity doesn't make sense, you think it would also slow the acceleration.

    This application has to apply to a cannon ball and a golf ball...two round objects of completely different mass.
    "From what was there, and was meant to be, but not of that was faded away." - - Steve Damm

    "The polar opposite of nothingness is existance. When existance calls apon nothingness it shall return to nothingness." - - Steve Damm

    "When you do things right, people won't be sure if you did anything at all." - - God from Futurama

  5. #5

    Thread Starter
    PowerPoster Halsafar's Avatar
    Join Date
    Jun 2004
    Location
    Saskatoon, SK
    Posts
    2,339

    Re: Cannon Shot Questions - Some Physics

    I give my ball an acceleration and an initial force to apply to the acceleration...like the explosion in the cannon.

    Gravity applies to the current velocity right?
    So -- some accelerations could very well lift a cannon ball up forever?
    This seems to happen, if I hit the ball with enough force it NEVER comes down because the acceleration in the y direction is way greater than the cumulated gravity vector.
    "From what was there, and was meant to be, but not of that was faded away." - - Steve Damm

    "The polar opposite of nothingness is existance. When existance calls apon nothingness it shall return to nothingness." - - Steve Damm

    "When you do things right, people won't be sure if you did anything at all." - - God from Futurama

  6. #6
    Fanatic Member
    Join Date
    Dec 2003
    Posts
    703

    Re: Cannon Shot Questions - Some Physics

    A cannonball is only accelerated by the cannon for a small time, during the firing process. After that the main forces on it are gravity, and air resistance.

    The cannonball will only never come back down if its velocity just after firing is greater than the Earth's escape velocity - you can easily calculate the escape velocity by considering energy conservation.

    You seem to have the idea that the cannonball is accelerated upwards during flight - this isn't true - the upwards force and acceleration only applies during the firing process.
    an ending

  7. #7

    Thread Starter
    PowerPoster Halsafar's Avatar
    Join Date
    Jun 2004
    Location
    Saskatoon, SK
    Posts
    2,339

    Re: Cannon Shot Questions - Some Physics

    Yes I did recently read an article which confirmed all youve said.

    The ball is fired at a 45 degree angle for example, it has inital upward acceleration but the pull of gravity immediatly begins to apply to the acceleration as soon as it leaves the barrel.

    So, I have a question.

    Doing physics (assume we are in a vacuum):
    Is it accurate that a CannonBall: (all is measured in milliseconds)
    Mass - 113.0f kg
    ShotForce - 20km/ms
    Angle - 90 Yaw, 45 Degree Pitch (face north, arc cannon at 45 deg up)

    According to the near realistic app i've built:
    Ball Travels: 4.11km, peak height 0.75km


    Edit: The average weight of a cannon ball is 491.4kg or 30 pood (1 pood = 16.38 kg). My application is an attemp to create an environment for any ball.
    Last edited by Halsafar; Feb 23rd, 2005 at 03:22 PM.
    "From what was there, and was meant to be, but not of that was faded away." - - Steve Damm

    "The polar opposite of nothingness is existance. When existance calls apon nothingness it shall return to nothingness." - - Steve Damm

    "When you do things right, people won't be sure if you did anything at all." - - God from Futurama

  8. #8
    Fanatic Member
    Join Date
    Dec 2003
    Posts
    703

    Re: Cannon Shot Questions - Some Physics

    20km/ms
    Do you mean 20km/s, as in 20 000 m/s?

    At that speed it'll go into space!

    (I think the escape velocity for earth is around 13km/s)
    an ending

  9. #9

    Thread Starter
    PowerPoster Halsafar's Avatar
    Join Date
    Jun 2004
    Location
    Saskatoon, SK
    Posts
    2,339

    Re: Cannon Shot Questions - Some Physics

    Yah -- That flaw is obvious.

    Anyone want to check my math for me?

    //Get time -- the time passed between the frames -- in milliseconds
    t = m_Timer.GetDelta();

    //Apply Gravity
    m_vBallAccel.y += m_vGravity.y; //(-9.81 / 1000) -- the time is applied next

    //Continue to accerate velocity
    m_vCannonBallVel += m_vBallAccel * t;

    //Determine displacement -- first new position then the true displacement
    Vector vDisplacement = m_vCannonBallPos + (m_vCannonBallVel) +
    m_vBallAccel*0.5*(t*t);
    vDisplacement = vDisplacement - m_vCannonBallPos;

    //Deal some collisin detection, then add the displacement to the CannonBallPos


    Edit: I do not think I have this down right.
    "From what was there, and was meant to be, but not of that was faded away." - - Steve Damm

    "The polar opposite of nothingness is existance. When existance calls apon nothingness it shall return to nothingness." - - Steve Damm

    "When you do things right, people won't be sure if you did anything at all." - - God from Futurama

  10. #10
    Fanatic Member
    Join Date
    Dec 2003
    Posts
    703

    Re: Cannon Shot Questions - Some Physics

    Vector vDisplacement = m_vCannonBallPos + (m_vCannonBallVel) +
    m_vBallAccel*0.5*(t*t);
    It's simpler than that:

    DisplacementThisInterval = (Average Velocity over Interval) * dt

    You can approximate the average velocity by (NewVel + OldVel) / 2. Or just use NewVel, it probably won't matter unless you're going for actual physical modelling (but in that case the whole discussion is a bit moot).
    an ending

  11. #11

    Thread Starter
    PowerPoster Halsafar's Avatar
    Join Date
    Jun 2004
    Location
    Saskatoon, SK
    Posts
    2,339

    Re: Cannon Shot Questions - Some Physics

    what is dt?
    t is time. whats d? distance?

    I am going for real physics.
    I am writing a tiny physics simulator, where you fire a ball from a cannon, you get to set all the variables of the ball and the force of the blast.

    The project is to prepare for my next game I plan to create. If you can assist me that would be great. As of now I am working in a vacuum, so I need to find the proper velocity, acceleratin, gravity equatins -- the realistic ones. All I can locate is the corner cutting equations for most games.
    Last edited by Halsafar; Feb 24th, 2005 at 05:08 PM.
    "From what was there, and was meant to be, but not of that was faded away." - - Steve Damm

    "The polar opposite of nothingness is existance. When existance calls apon nothingness it shall return to nothingness." - - Steve Damm

    "When you do things right, people won't be sure if you did anything at all." - - God from Futurama

  12. #12
    Fanatic Member
    Join Date
    Dec 2003
    Posts
    703

    Re: Cannon Shot Questions - Some Physics

    dt is a time interval, in maths/physics you use d(something) to represent a small amount of it (a differential) - so dt is a short time interval.
    an ending

  13. #13

    Thread Starter
    PowerPoster Halsafar's Avatar
    Join Date
    Jun 2004
    Location
    Saskatoon, SK
    Posts
    2,339

    Re: Cannon Shot Questions - Some Physics

    As d as in Delta as in that triangle with a thick side...
    You know, after all the physics sites I've been studing, none have notation...I always just assumed d was delta..
    "From what was there, and was meant to be, but not of that was faded away." - - Steve Damm

    "The polar opposite of nothingness is existance. When existance calls apon nothingness it shall return to nothingness." - - Steve Damm

    "When you do things right, people won't be sure if you did anything at all." - - God from Futurama

  14. #14
    Fanatic Member
    Join Date
    Dec 2003
    Posts
    703

    Re: Cannon Shot Questions - Some Physics

    (delta)t = "a small but finite time interval"

    dt = "an infinitesimal time interval"

    dt is a differential. If you want to know more, read up on calculus.

    I am going for real physics.
    Again, how real? You will have to cut corners at some point.
    an ending

  15. #15

    Thread Starter
    PowerPoster Halsafar's Avatar
    Join Date
    Jun 2004
    Location
    Saskatoon, SK
    Posts
    2,339

    Re: Cannon Shot Questions - Some Physics

    Real enough to simulate close to perfect golf.
    I am not going to simulate wind currents but I do intend on creating wind.
    I do intend on putting spin into the equation and how the air effects it, how the spin effects its bounce.

    I just cannot seem to find the ideal website to study from....I think I may finally have one tho.

    No I am not making a golf game, and I am not going to take into consideration the mis-shapen sphere's either. Like a golf ball has dimples to aid its spin and keep it in the air longer. A spinning golf ball with dimples in the air travels FARTHER than in a vacuum. But I will always assume what is being fired is a perfectly round shape.
    Last edited by Halsafar; Feb 24th, 2005 at 08:05 PM.
    "From what was there, and was meant to be, but not of that was faded away." - - Steve Damm

    "The polar opposite of nothingness is existance. When existance calls apon nothingness it shall return to nothingness." - - Steve Damm

    "When you do things right, people won't be sure if you did anything at all." - - God from Futurama

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width