# Generating a “flare” effect in Graphics3D?

I'm attempting to indicate that there is a point-source of light at some position in a Graphics3D-generated image. Is there any built-in tool to do this? My patch-work solution thus far has been to imagine a sphere of radius $r$ centered at that point, and to generate a large set of diameter-length chords inside of the sphere. Surely there must be a better way that doesn't involve creating so many line or cylinder primitives?

-

Not very pretty, but:

Graphics3D[{
Gray,
Specularity[3, 5],
Sphere[],
Cuboid[{-10, -10, -2}, {10, 10, -1}],

{ (* light *)
White,
EdgeForm[None],
Glow[Yellow],
Opacity[0.5],
Scale[
Translate[
PolyhedronData["GreatStellatedDodecahedron", "Faces"],
{2, 2, 10}],
3]
}
},
Lighting -> {{"Point", Yellow, {2, 2, 10}},
{"Directional", White, {0, 0, 20}}},
Boxed -> False,
Background -> Gray
]


-
I like it! Is there an easy way for me to generate these polytope's at a list of 3D coordinates? –  user7231 May 2 '13 at 12:21
@user, try PolyhedronData["GreatStellatedDodecahedron", "VertexCoordinates"]. See the docs for more details. –  Ｊ. Ｍ. May 2 '13 at 12:29
@J.M. That doesn't quite seem to work? Can I do something like: Graphics3D[{Table[Translate[PolyhedronData["Icosahedron"],CoordinateList[[i]]], {i, 1, Length[CoordinateList]}]}]? –  user7231 May 2 '13 at 12:35
@user, then I don't understand what you want. You ask for something that generates coordinates, I showed you a command that generates a pile of coordinates, and now you want a picture. What now? –  Ｊ. Ｍ. May 2 '13 at 12:51
@J.M. Sorry, I think I'm not being very clear on my end. I meant, I'd like to position some number $N$ of these polytopes in 3-space at coordinates I specify with a list. I think you thought I was asking for the coordinates of the polytope vertices. Sorry about that. –  user7231 May 2 '13 at 12:57

Maybe using some Lines to simulate a flare star:

flarerays = Normalize /@ RandomVariate[NormalDistribution[], {500, 3}];

Graphics3D[{
White, Specularity[.1, 10], Sphere[],
Opacity[.1],
Orange,
Line[{{1, 1, 2}, {1, 1, 2} + 10 #}] & /@ flarerays,
Blue,
Line[{{-1, 1, -1}, {-1, 1, -1} + 10 #}] & /@ flarerays
},
Lighting -> {
{"Point", Orange, {1, 1, 2}},
{"Point", Blue, {-1, 1, -1}}
},
PlotRange -> {{-2, 2}, {-2, 2}, {-2, 3}},
Background -> Black]


-
Pretty! So a +1 ... –  cormullion May 2 '13 at 21:46
@cormullion Thanks :) I used similar flaring thing as splash screen picture for some of my packages :) –  Silvia May 2 '13 at 21:51
Might be cheaper to use flarerays = Normalize /@ RandomVariate[NormalDistribution[], {500, 3}] –  Ｊ. Ｍ. May 3 '13 at 0:20
@J.M. Yes indeed! Have added to the code. Thanks :) –  Silvia May 3 '13 at 5:05
nice+1 2, so space ! –  HyperGroups Mar 15 '14 at 16:08

Also not very pretty:

lights = {{"Point", Green, {5, 0, 0}}, {"Point", Red, {0, -5, 0}}};
indicators = Text[Style["*", 50, Bold, #2], #3] & @@@ lights;

Graphics3D[{Sphere[{0, 0, 0}, 3], indicators}, Lighting -> lights]


-
–  belisarius May 2 '13 at 13:16
"Also not very pretty", actually I disagree, and its fantastic to learn how to do this. –  user7231 May 2 '13 at 13:22