10 Replies Latest reply on Jan 16, 2007 4:44 AM by pj20

# parabola in director

hello,
this is the first time i use this site. i have been told that this is a good place to get help with using director. in director on the main stage i have drawn a ball, what i want to do, i want it to move up into the air and then drop again in the shape of a wide parabola. i have tried the following code: y=ax^2+bx+c, with a=-0.5, b=50 and c=5, but i must have got something wrong. can anyone help me with this? let me know where i am going wrong and what formula i should use instead?
thanks
pj20
• ###### 1. Re: parabola in director
Check out this great site animation math in lingo

http://www.jmckell.com/

hth

johnAq
• ###### 2. Re: parabola in director
you can always make it with a spline or a vectorshape. should be fairly easy to first make a circle and then reshape it into a parabola
• ###### 3. Re: parabola in director
Thanks for your help but i still have not got anywhere i need to have the equation written in lingo code .. i will be shooting a cannon ball from a cannon so i need to no how to write the equation out so i can attach this to the frame

jacs
• ###### 4. Re: parabola in director
You might just have to do a bit of searching when someone offers a URL. I
spent, well, maybe 30 seconds and came up with this

http://www.jmckell.com/generalgravity.html

What you're looking for is really a gravity equation. This will take care
of your vertical movement. Since mass travels at a constant velocity you
can animate using a constant change in the locH and use the gravity math to
calculate the vertical change as it rises and falls.

--
Craig Wollman
Lingo Specialist
Word of Mouth Productions
212-928-9581

www.wordofmouthpros.com
"pj20" <webforumsuser@macromedia.com> wrote in message
news:eo3l2e\$nsm\$1@forums.macromedia.com...
> hello,
> this is the first time i use this site. i have been told that this is a
> good
> place to get help with using director. in director on the main stage i
> have
> drawn a ball, what i want to do, i want it to move up into the air and
> then
> drop again in the shape of a wide parabola. i have tried the following
> code:
> y=ax^2+bx+c, with a=-0.5, b=50 and c=5, but i must have got something
> wrong.
> can anyone help me with this? let me know where i am going wrong and what
> formula i should use instead?
> thanks
> pj20
>

• ###### 5. Re: parabola in director
I meant to say constant horizontal velocity.

--
Craig Wollman
Lingo Specialist
Word of Mouth Productions
212-928-9581

www.wordofmouthpros.com
"forum.macromedia.com" <lingoboy@wordofmo.com> wrote in message
news:eo8obs\$323\$1@forums.macromedia.com...
> You might just have to do a bit of searching when someone offers a URL. I
> spent, well, maybe 30 seconds and came up with this
>
> http://www.jmckell.com/generalgravity.html
>
> What you're looking for is really a gravity equation. This will take care
> of your vertical movement. Since mass travels at a constant velocity you
> can animate using a constant change in the locH and use the gravity math
> to calculate the vertical change as it rises and falls.
>
> --
> Craig Wollman
> Lingo Specialist
> Word of Mouth Productions
> 212-928-9581
>
> www.wordofmouthpros.com
> "pj20" <webforumsuser@macromedia.com> wrote in message
> news:eo3l2e\$nsm\$1@forums.macromedia.com...
>> hello,
>> this is the first time i use this site. i have been told that this is a
>> good
>> place to get help with using director. in director on the main stage i
>> have
>> drawn a ball, what i want to do, i want it to move up into the air and
>> then
>> drop again in the shape of a wide parabola. i have tried the following
>> code:
>> y=ax^2+bx+c, with a=-0.5, b=50 and c=5, but i must have got something
>> wrong.
>> can anyone help me with this? let me know where i am going wrong and what
>> formula i should use instead?
>> thanks
>> pj20
>>
>
>

• ###### 6. Re: parabola in director

Hi,

You might also be interested in looking at the Bezier Curve Xtra
http://www.the-mindseye.co.uk/prog/beziercurve.shtml

I haven't used it but from my understanding, you can create a curve and link an
animation to it. So, you may be able to create that curve based on some
mathematical formula and set it as your animation path.

regards
Dean

Director Lecturer / Consultant
http://www.fbe.unsw.edu.au/learning/director
http://www.multimediacreative.com.au

• ###### 7. Re: parabola in director
FWIW, there's a tutorial on creating a ballistic motion simulation in my
first book: Director 8.5 The Complete Reference...chapter 6. It's for 8.5
but nothing has changed as far as this goes. You can get a copy pretty
cheaply these days too...

--
Dave -
www.blurredistinction.com

• ###### 8. Re: parabola in director
oh now i understand what you want to do.
You want to simulate the ball flying from a cannon.

this is called the Euler Integration (i think):
You can do it a lot more accurate but thats another story,
Anyway you might have to tweak the values and constants to make it look good.

property pVel, pPos, pAirFriction, pGravityConstant
on beginSprite me
pPos = point(100,100)
pVel = point(3,-3) -- 40 degrees up
pGravityConstant = point(0, 0.9)
pAirFriction = 0.09
end

on exitFrame me
-- this will step the position each frame with the velocity
-- it will remove some speed in the bullet due to air friction
-- the gravity will pull it down
pPos = pPos + pVel*pAirFriction + pGravityConstant
--remember its good to keep the position and velocity in a variable
-- instead of using sprite(x).loc cos' its only integer not float so you loose som
-- precision.
sprite(me.spritenum).loc = pPos
end

you can of cource calculate where the ball will be at any given moment with a function but i think youll have to solve that out your self.
i can give you some links for help:
http://en.wikipedia.org/wiki/Trajectory
http://scienceworld.wolfram.com/physics/Trajectory.html
• ###### 9. Re: parabola in director
Thanks for your reply does all the code go onto one frame
• ###### 10. Re: parabola in director
I have it working the ball fires at a angle but just keeps going how would i bring it down because the gravity variable is not doing much could you help please ....

pj20