RE: [Algorithms] Scrolling starfield
Brought to you by:
vexxed72
From: Ken C. <Ken@HELIKON.com> - 2002-07-30 18:40:42
|
Instead of moving the Y and Z randomly when you add the cube length to X, you could do it by a reversible function. That way if the player went "back", you could get the original positions back. Ken Carpenter -----Original Message----- From: jeffrey Rainy [mailto:jr...@ma...] Sent: July 30, 2002 11:12 AM To: Tom Forsyth; gda...@li... Subject: RE: [Algorithms] Scrolling starfield This would work fine, except for the fact that any weird-shaped cluster of star that you pass by will be encountered again at every cube length when you move in an axis-aligned direction. And that could be noticed. An easy fix for that is to randomize the star position on the plane perpendicular to the axis value you are changing. i.e. if you add a cube length to X, just randomize Y and Z on the cube face. That way you get nice random distirbuted stars. However, if your players goes back a cube length, the stars will have moved. Depends on your game style, I guess. ;-) J. -----Original Message----- From: gda...@li... [mailto:gda...@li...]On Behalf Of Tom Forsyth Sent: Tuesday, July 30, 2002 13:36 To: gda...@li... Subject: RE: [Algorithms] Scrolling starfield Probably the easiest way to do this is just to fill a cube surrounding the player with N stars, fading out with distance so that they are black at the greatest distance. When the player moves, see which stars are now outside the cube, and "wrap" them (i.e. add or subtract the length of a cube edge to the appropriate coordinates) so that they go back inside the cube. That way you get a nice even distribution of stars wherever you go, and all the rest (parallax, turning, etc) Just Work. That's assuming you don't mind drawing about six times as many starts as will actually be visible of course (for a 90-degree FOV). Usually it's not a problem on modern hardware though - a nice big batch, very easy for the card to reject. Tom Forsyth - purely hypothetical Muckyfoot bloke. This email is the product of your deranged imagination, and does not in any way imply existence of the author. > -----Original Message----- > From: Brian Hook [mailto:bri...@py...] > Sent: 30 July 2002 18:35 > To: gda...@li... > Subject: [Algorithms] Scrolling starfield > > > Hopefully this question is not as stupid as I fear it is. > > I'm working on a top down display right now, Asteroids style, > but in 3D > (i.e. it's a camera positioned over the scene instead of a pure 2D > projection). Doing a regular star field is obviously trivial, but I'd > like to have a starfield with a certain amount of arbitrary parallax > (not just parallax layers). > > (Yes, I know that when dealing with distances in light years, that > parallax is not visible, but it gives a sense of movement to the scene > =P) > > The obvious way to do this, to me, is to generate N stars inside the > view frustum. In a nutshell, the scene is composed as if > you're looking > through a viewfinder straight down. This is the frustum. At some > distance away from the near plane is the "ship plane" where > your ship is > located (always centered in the screen). > > Filling the volume with evenly distribute points bounded by the "ship > plane", far plane, and frustum sides seems like a trivial > operation, but > so far I haven't come up with anything that's been blindingly > intuitive. > Everything I've come up with has been grossly complex, in fact. > > That aside, I'm not sure this solves my problem entirely, because > there's the scrolling/wrapping element as well. If the > starfield was on > a single plane, I could simply translate all stars by some > modded value > of the ship's translation to get the proper effect. However, with > perspective projection thrown in and stars at various values, a single > translation is impossible for all stars. > > So maybe I'm just going about this all wrong. Even with all of the > above working, it would end up causing problems if I suddenly > decided to > go to a virtual trackball interface instead of a top down interface. > > > Brian > > > > ------------------------------------------------------- > This sf.net email is sponsored by: Dice - The leading online job board > for high-tech professionals. Search and apply for tech jobs today! > http://seeker.dice.com/seeker.epl?rel_code=31 > _______________________________________________ > GDAlgorithms-list mailing list > GDA...@li... > https://lists.sourceforge.net/lists/listinfo/gdalgorithms-list > Archives: > http://sourceforge.net/mailarchive/forum.php?forum_id=6188 > ------------------------------------------------------- This sf.net email is sponsored by: Dice - The leading online job board for high-tech professionals. Search and apply for tech jobs today! http://seeker.dice.com/seeker.epl?rel_code=31 _______________________________________________ GDAlgorithms-list mailing list GDA...@li... https://lists.sourceforge.net/lists/listinfo/gdalgorithms-list Archives: http://sourceforge.net/mailarchive/forum.php?forum_id=6188 ------------------------------------------------------- This sf.net email is sponsored by: Dice - The leading online job board for high-tech professionals. Search and apply for tech jobs today! http://seeker.dice.com/seeker.epl?rel_code1 _______________________________________________ GDAlgorithms-list mailing list GDA...@li... https://lists.sourceforge.net/lists/listinfo/gdalgorithms-list Archives: http://sourceforge.net/mailarchive/forum.php?forum_ida88 |