Link to home
Start Free TrialLog in
Avatar of maxb
maxb

asked on

Drawing an arch

Hi All,
I have a JPG image of a map and a gif of a little airplane with black being transparent. I want to give the impression that the plane takes off from one city and lands in another. How do I move the plane as well as draw a red 3px antialiased line as the "flight" path between two citis of the map? The flight path should slightly curve up to simulate takeoff and then back down for landing.

The plane should move as the "lead" of the flight path.

Thank you so much!!

P.S. I just want a function to which I can pass four parameters city1x/y and city2x/y
Avatar of ginsonic
ginsonic
Flag of Romania image

Hello  maxb, I can sort of see what you want to do, but to have an animation (moving plane) along an Arc is NOT an easy thing to do. What if the first city is directly above the second city? Or the second city is to the left of the first city, does your plane fly backwards? I can do code to make an Arc between to any two points, but the animation may need some more info from you about how you want to do it.
Avatar of maxb
maxb

ASKER

What if it was just a straight line? Would it be easier? The plane would always face the desitnation city, I could make like 8 versions with different possible angles?
well,  straight line sprite movement would be easier, but the arc movement  can be done, , , as to the "Plane" image direction, if you are artistic and can do 8 bitmaps with the plane pointing in the 8 compass directions, then you can use those 8 bitmaps in an array, but you will need to determine which plane to use, do you have much trigonometry experience?

I guess you do not have much experience with animation? I have some code that uses a single plane bitmap, and moves the plane, in an arc, from one point to another on a TPaintBox, it also draws the Arc in red behind the plane. I could post it if your want to see it.
Avatar of maxb

ASKER

Anything would help at this pont, I really have no animation experience. I'm considering the DelphiX components....
ASKER CERTIFIED SOLUTION
Avatar of Member_2_248744
Member_2_248744
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of maxb

ASKER

Wouldnt delphix allow me to have a map background and a plane sprite animation for smooth movement? Thank you so much for the code, I'll play with it tonight.
oh yea, I did not mean that delphix could not do it, but with modern computers (above 800 MHz) and modern graphics cards (8 MBytes and up) you got pretty good graphics speed, if you know what you are doing, and can do some sprite movements that are good, but the delphix is a whole thing to learn, just for a little plane movement. . . . if you wanted a fully navigatable 3D environment, with  several 3D planes with laser guns and jet flames, that would explode in to smoke and flying wreckadge, then I can see going to delphix
Avatar of maxb

ASKER

I had some issues with my delphi last night, it kept on saying it was missing some config file. I'll have to reinstall it tonight, im sorry for the delay.

On the map, I want to have an animated gif? to designate the possible destinations, is that prety simple to animate without flicker? I just want like a circle that sort of looks 3d that starts small and ends larger sort of pulsating. Any tips? :)
???
no tips, but for me, I would start out simple and learn how to do something basic (a NON animated plane movemant animation with out ARC or circular movement) and then try and add  new features and improvements as I learned what to do and how to do it. . . you ask -
" is that prety simple to animate without flicker"
I do NOT think it would be simple for someone who has not done animation.
I remember that I gave some code for animation in another EE question at

https://www.experts-exchange.com/questions/20718280/need-some-help-with-timers-and-moving-an-image-around-the-outline-of-a-screen.html

but the questioner did not understand it, my animation code in the first example that I give on this question might be a good place to start for a simple (or not) animation example
Avatar of maxb

ASKER

LOL Thats hilarious. Thank you so much for your help, can't wait to get it all together hopefully tonight.
Avatar of maxb

ASKER

the plane animation worked awesome, but I have an issue paqying $31 for a timer, is there another approach for the animation?
I'm glad you got it to work, I am not sure about the price you mention  $31, maybe you are joking?
but I am not getting what you are saying (asking), If it's a joke , , I don't get it. . . . . . . .
Avatar of maxb

ASKER

Oh... the only multimedia timer I was able to find was shareware and cost $31 to run without IDE... is there another?
???
I can not understand what you are talking about?
There is no multimedia timer in the code for the plane animation, I use a plain old delphi  TTimer

If you are some how referring to the -

https://www.experts-exchange.com/questions/20718280/need-some-help-with-timers-and-moving-an-image-around-the-outline-of-a-screen.html

question, it does use a   "multimedia timer"  , , but it is  IN THE CODE, it is NOT a separate component, it is called by API functions to setup, start and finish a multimedia timer event
Avatar of maxb

ASKER

I'm sorry, i was talking about the other animation, not the plane one.

Delphi hiccups at TimeCaps: TTimeCaps; and says it has no idea what TTimeCaps is.
OK, I forgot to place the

uses mmsystem;

in the code

TTimeCaps in in the mmsystem.pas source code
Avatar of maxb

ASKER

Thank you SO much for all your help