Many space shooters use this concept where you are the pilot that looks out from the front window, lasering down enemies for bounty, right. Ever noticed spacedust? It’s very subtle when it is used, but it adds to the realism of outer space, making the space feel less empty, less static.

Here’s how you can do that in Papervision3D, using ParticleFields. I’ve used the trunk of the papervision code repository, revision 851, but it should work with the last release without to much hassle. Note that I’m no PV3D guru; I just started to learn this stuff and I’m just sharing what I’ve learned so far.

(note: space dust uses the skybox from the skybox tutorial)
    Here’s how it works:

  • divide space into a 3d grid and parts of the spacedust cloud on 8 gridpoints directly around the camera (the ship), we’ll call these dustpockets
  • when the camera moves, dustpockets are removed and created to keep only the 8 gridpoints around the ship occupied

read on