Article View: rec.games.programmer
Article #404Moving things around
From: Pat Draper
Date: Tue, 04 Aug 1992 04:30
Date: Tue, 04 Aug 1992 04:30
34 lines
2098 bytes
2098 bytes
I've adapted the Bresenhan line drawing algorithm for the purpose of moving objects around on the screen. I'm pretty proud of my work so far (half done) but the idea is most likely not original with me. I'm writing the programmer's equivalent to the literate's "Great American Novel" - the Great American Star Trek Game. :-) (How many of these ARE there I wonder.) Anyway, I needed a quick way to move an object along a line from point x to point y, and Bresenhan was close to what I wanted. It's entirely integer, so it's fast. Is the thing patented? I wouldn't want to cause trouble.. To get the endpoints of my line, I plan on using a single sequence of transcendental functions and floating point to calculate polar coordinates, with the current ship position at the center.I figure that the overhead will not be very great since the calculations will have to be done relatively infrequently. Does anyone have any INTEGER methods of calculating polar coordinates and/or translations? I'd be most interested, since the single floating point location in my code could possibly turn into a performance limiter. Also, what methods have anyone else come up with similar/different to my own to solve the spaceship movement problem? Thanks for any comments, answers, and flames. ------------------////////////////////\\\\\\\\\\\\\\\\\\\\------------------ | Patrick Draper Disclaimer: I can't control my fingers, | | draper@irie.ais.edu I can't control my toes! - Ramones | | University of Michigan | | Computer Club We are a nation of laws, not people | ------------------\\\\\\\\\\\\\\\\\\\\////////////////////------------------
Technical Details
Message-ID:
<BsFz6J.IyG@ais.org>Path:
arc1-ca.pugleaf.net!sparky!uunet!sun-barr!cs.utexas.edu!zaphod.mps.ohio-state.edu!sol.ctr.columbia.edu!destroyer!ais.org!draperShow Full Headers
Complete Article Headers
Newsgroups: rec.games.programmer Path: arc1-ca.pugleaf.net!sparky!uunet!sun-barr!cs.utexas.edu!zaphod.mps.ohio-state.edu!sol.ctr.columbia.edu!destroyer!ais.org!draper From: draper@ais.org (Pat Draper) Subject: Moving things around Message-ID: <BsFz6J.IyG@ais.org> Organization: UMCC Date: Tue, 4 Aug 1992 04:30:18 GMT Lines: 34