Mathematica Stack Exchange is a question and answer site for users of Mathematica. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I tried to use Glow to create a neon light effect on a torus object. The result shown on the left of the picture below looks quite different from the real one on the right. Is there a way to obtain a better result?

(* Assuming the .obj file located in the root of c: *)
model =  Import["c:\\torus.obj"] ;
 Graphics3D[{Glow[Cyan], First[model ] }, Boxed -> False ,
 Background -> Black
  ]

enter image description here

share|improve this question
up vote 32 down vote accepted

This rasters the image first and then applies a convolution to the 2d image. At the end, the result is combined whith the image rendered with "Glow":

model = Import["../torus.obj"];
hColor = RGBColor[0.2, 0.5, 1];
img = Graphics3D[{hColor, Opacity[0.5], EdgeForm[hColor], 
   First[model][[2 ;; -1]]}, Boxed -> False, Background -> Black];
img0 = Graphics3D[{Glow[Cyan], Opacity[0.9], First[model]}, 
   Boxed -> False, Background -> Black];
cv = Table[
ImageMultiply[ImageConvolve[img, GaussianMatrix[{r, r/3}]], 
r/15], {r, {10, 50, 150}}];
ImageAdd[img0, ImageAdd[cv]]

enter image description here

You might have to play a bit with the parameters to get the desired result.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.