Trajectory path and movement (as well as reintroducing myself)

Player_EPlayer_E Member, PRO Posts: 604
First off I want to say hello to everyone. I'm an old time user back from early 2009, I took a break for a little over a year due to some time constraints and now i'm back.

now to get to my question. I've been working on a new project for a little over a week now and have been stuck on figuring out how to work trajectory path for a moving object.

I have found this video searching the forums and this is exactly what I am looking for:



Yes, I know Orbz has a trajectory demo over on gshelper.com and I have been fussing with that demo for a little over 3 days now and still cant figure out how the guy (genius) in the video accomplished what he did.

Any help or direction would be very much appreciated.

Thank you and its good to be back, im super excited about my new project :)

Comments

  • Player_EPlayer_E Member, PRO Posts: 604
    So, I have my trajectory path set up from a stationary position and I want the arrow to rotate around the arc that is drawn from the trajectory path, so it looks like the tip of the arrow goes towards the ground when it begins to fall.

    From my math experience my initial instinct is that I would need to use a derivative of the function (equation) that created my trajectory path since a derivative calculates the instantaneous rate of change. I have come up with what I believe works, but under some circumstances it fails.

    this is what I have

    under the arrow actor that is spawned when shot

    timer: every 0.1 seconds
    rotate to angle
    angle = -(velocity*cos(launch_angle))
    speed = distance traveled/time of flight

    explanation of the speed portion. I used a formula that calculated the total X distance traveled along the horizontal plain according to the velocity and angle used. I also used a formula that calculated the time the arrow would be in the air along the trajectory path. so in order to get the speed of the rotation I used the simple speed = distance/time formula

    explanation of the (-) in front of my angle equation is because the negative makes the arrow head lean down towards the ground while a positive angle would make it lean up towards the sky.

    this works when there is an extreme curve to the trajectory, but doesn't work at all when the path is more flat.


    Can anyone let me know if I am on the right path with my thinking of the derivative, or if I'm looking in the wrong place all together.

    Any help would be great
  • tatiangtatiang Member, Sous Chef, PRO, Senior Sous-Chef Posts: 11,949
    This is over my head but you might take a look at @Socks' demo here: http://forums.gamesalad.com/discussion/63512/physics-help.

    New to GameSalad? (FAQs)   |   Tutorials   |   Templates   |   Greenleaf Games   |   Educator & Certified GameSalad User

  • Player_EPlayer_E Member, PRO Posts: 604
    thanks, that is basically exactly what I'm looking for
  • tatiangtatiang Member, Sous Chef, PRO, Senior Sous-Chef Posts: 11,949
    You're welcome. I merged your two threads.

    New to GameSalad? (FAQs)   |   Tutorials   |   Templates   |   Greenleaf Games   |   Educator & Certified GameSalad User

  • Player_EPlayer_E Member, PRO Posts: 604
    Well, Im still looking for a solution to recreate what is seen in the video posted
  • Player_EPlayer_E Member, PRO Posts: 604
    last bump before I let this sink the the deep depths of the thread
Sign In or Register to comment.