I'm creating 3D nebulae models for Celestia, a free OpenGL astronomy software. The following question is in part related to another one I already asked on this forum (see this question, for which I now have a complete answer.
I also want to create some irregular nebulae, a bit like the Orion and the Carina nebulae (see this page on Wikipedia, about the Carina nebula). In this case, there is no symetry to help building the model, so I was thinking about some random walks. The following code draws a bunch of random walks in 3D, and is working very well (it could be simplified a bit, but this isn't the question) :
RandomWalkCoords = Flatten[
Table[
{x, y, z} = {RandomReal[{-10, 10}], RandomReal[{-10, 10}], RandomReal[{-10, 10}]};
p = 0.1;
{u, v, w} = {0.0, 0.0, 0.0};
NestList[(
u += RandomReal[NormalDistribution[0, s]];
v += RandomReal[NormalDistribution[0, s]];
w += RandomReal[NormalDistribution[0, s]];
# + p {u, v, w}) &,
{x, y, z},
50],
{s, 0.1, 1, 0.05}],
1];
max = Max[Norm/@RandomWalkCoords];
PlotColors = ColorData["SunsetColors"];
Graphics3D[
Table[
{x, y, z} = {RandomReal[{-10, 10}], RandomReal[{-10, 10}], RandomReal[{-10, 10}]};
p = 0.1;
{u, v, w} = {0.0, 0.0, 0.0};
Line[
NestList[(
u += RandomReal[NormalDistribution[0, s]];
v += RandomReal[NormalDistribution[0, s]];
w += RandomReal[NormalDistribution[0, s]];
# + p {u, v, w}) &,
{x, y, z},
50]],
{s, 0.1, 1, 0.025}],
Axes -> True,
AxesStyle -> Opacity[0.25],
AxesOrigin -> {0, 0, 0},
SphericalRegion -> True,
PlotRange -> {{-25, 25}, {-25, 25}, {-25, 25}}]
Graphics3D[
{PlotColors[Norm[#]/max], Sphere[#, 0.1]} &/@RandomWalkCoords,
Boxed -> False,
Background -> Black,
Lighting -> "Neutral",
SphericalRegion -> True]
So my question is this: I need to "blurr" the distribution of points around each random walk path; i.e., the points should be scattered randomly (using some kind of thickness parameter) so the curves take on volume. They should represent clouds of gas and dust in the nebula. How should I do this ?
The "thickness" parameter should also be random for each random walk. There should be another parameter to control the global rendering.
Take note that I'm working on Mathematica 7.0. So your suggestions should be compatible with this version.
EDIT Using a variation of the code below, I'm now able to generate some very nice nebula models. Here's an example, as seen in Celestia : A nebula in Celestia. It may look a bit timid, crude and simplistic, but this is just a first experimental version.

