Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!eu.feeder.erje.net!news.swapon.de!eternal-september.org!feeder.eternal-september.org!mx02.eternal-september.org!.POSTED!not-for-mail From: Uncle Steve Newsgroups: comp.programming Subject: Re: patroling space recipe Date: Wed, 01 Apr 2015 18:07:30 -0400 Organization: A noiseless patient Spider Lines: 60 Message-ID: <9e2dcd36ccee724-431c3@gmail.com> References: <048bba75-6985-4edf-9bd5-f9f1e774c3a9@googlegroups.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 8bit Injection-Info: mx02.eternal-september.org; posting-host="dfca600df3027c25a5e3889f25105c66"; logging-data="24935"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+DmOldLXDw1fCCY8C/ro3r" User-Agent: nn 6.7.3 Content-Length: 1587 Cancel-Lock: sha1:+XcRt445WUxbYh5/r9Oai53ubXg= Xref: csiph.com comp.programming:5372 On Wed, Apr 01, 2015 at 06:58:07AM -0700, fir wrote: > I am lurking long time to do that > > probably it is not so hard to do > also is not so easy > > you got small starship (say 10 meters > long) you also need some small cosmic > station or 'buoy' in space > > the ship has to fly around the buoy > (not sure how far probably about 500 > meters, and waste a time - but in general > its movement should look nice, > > It could probably slowdown and > acclelerate and move gracefully > > I need a recipe for this movement when basic > operations you have is > > MoveForvard(float distance) > StrafeRight(float distance) > StrafeUp(float distance) > > MoveYaw(float distance) > MovePitch(float distance) > MoveRoll(float distance) > // (you know whats that, isnt, you) > > you may asume 50 frames per > second > > void MoveShip() > { > static frame = 0; > > MoveForvard(1.0); //50 m/s forward > > //... what recipe here ? > > frame++; > > } You can simplify the problem considerably if you choose a frame of reference in which the spaceship is at rest. Then, translate or rotate space about the spaceship in any way you like. With this method I am fairly sure that you will achieve framerates far in excess of your baseline rate, and which ought to leave plenty of computer horsepower for things like player missles and such. -- A farmer has twelve workers who require three weeks to harvest the farmer's fields. The farmer eats four workers. How long will it take him to harvest his crops if all of the other independent variables remain constant?