c_s245010114@stat.appstate.edu (03/27/91)
This may not be the right place to post this, but this is the only graphics news feed I have access to. I'm writing a program in Turbo C++ (not using too many C++ commands, so it's mostly just Turbo C) that uses some graphics. Without telling too much what the program does, I am trying to "launch" a projectile from the bottom of the screen and have it sort of "arc" upward. I have found several Calculus formulas for determining velocity/speed, and I am hoping to make the simulation fairly true-to-life as far as gravity goes. Imagine firing a bottle rocket up into the air. If you hold it at, say, 85 degrees, it arcs up and the velocity slows as it reaches the pinnacle of its arc. The only difference is, a bottle rocket accelerates as it goes up since the "thrusters" are still burning. With my computer simulation, the launch speed is as fast as it will ever go, because "gravity" will slow it down. My question is, what's the best way to devise the arc it will follow, using two pixels as the "bomb?" I will generate a random x-position at the bottom of the screen and a random angle of elevation. The "speed" will be a fixed value which I must mess around with. "Gravity" will also be a problem. Has anyone written this kind of code? I need some code that will move the pixels upward until it reaches speed=0 (at the top of the arc). Can anyone offer any advice or directions where I might look? I'm a poor college student, so buying books is out (the library here really sucks, too). Thanks in advance... BITNET: C_S245010114@appstate.bitnet Scott E. Schnegelberger INTERNET: C_S245010114@conrad.appstate.edu Appalachian State University "The smallest hole will eventually drain the largest container, unless it is made intentionally for drainage, in which case it will clog." - Dave Grissom