Re: [Algorithms] Scrolling starfield
Brought to you by:
vexxed72
From: brian h. <bri...@py...> - 2002-07-31 05:38:35
|
> (That code is a few years old.) PSD has alpha, and RLE. Plus it's > easy to export from Photoshop :) I even used the print-size meta info > to size my billboards. I didn't even realize PSD was a documented and/or open file format. File format support these days is rather trying -- I use TGA by default, primarily because it's more predictable than what I get when I save PNG in various packages. And TGA compresses very well (similar to PNG, if not identical) when ZIPped. And it supports a 16-bit file format for those of us still stuck in the dark ages. =) > > - rationale for WEATHER_BLOCK_SIZE = 14? > > Just tweaked until the furthest flakes were invisible. Ah, okay, just wanted to make sure I wasn't misunderstanding what it was. I mucked about with the code and it works beautifully! It took me a bit to get my head screwed on straight with respect to scale at times (the << 17 threw me off for a bit), but it seems to work. I have the ship centered in the star cloud right now, which looks wrong because stars can get between you and the ship, but a simple translation "behind" the ship should fix that. The packing into integers and letting integer wrap handle wrap around is just brilliant and elegant, if not obvious to everyone but me =) Brian |