# Distribution of random points in 3D space to simulate an Orion-like Nebula [closed]

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.

-

## closed as too localized by Jens, m_goldberg, Sjoerd C. de Vries, Verbeia♦Mar 13 '13 at 9:43

This question is unlikely to help any future visitors; it is only relevant to a small geographic area, a specific moment in time, or an extraordinarily narrow situation that is not generally applicable to the worldwide audience of the internet. For help making this question more broadly applicable, visit the help center.If this question can be reworded to fit the rules in the help center, please edit the question.

From the downvotes one can deduce that you should try to formulate the question in a more Mathematica specific way so that people don't have to embark on an open-ended research project to answer it. BTW, I didn't downvote, just trying to improve the chances of making this useful for others. –  Jens Mar 13 '13 at 5:07
Perhaps people are worried that you're going to work your way through the entire universe and want to discourage you a bit. But it might be a good idea to generalise your questions a bit, as Jens said. –  cormullion Mar 13 '13 at 8:01

Revised:

arms=Table[NestWhileList[{#[[1]]+RandomInteger[{-2,1}],#+RandomReal[{-1,1}]&/@#[[2]]}&,{RandomInteger[{25,30}],{0,0,0}},#[[1]]>15&],{10}];