Skip to main content
added 3 characters in body
Source Link
Yves Klett
  • 15.7k
  • 5
  • 59
  • 134

Not very effective, but useful if you go for postprocessing of existing Graphics primitives:

spheres = Sphere[#[[1 ;; 3]], #[[4]]/2] & /@ RandomReal[{-1, 1}, {10, 4}]; Graphics3D[spheres] 

Mathematica graphics

Graphics3D[spheres] /. s_Sphere :> Sequence[RGBColor[RandomReal[{0, 1}, 3]], s] 

Mathematica graphics

Repeated evalutation will yield individual coloring.

Not very effective, but useful if you go for postprocessing existing Graphics primitives:

spheres = Sphere[#[[1 ;; 3]], #[[4]]/2] & /@ RandomReal[{-1, 1}, {10, 4}]; Graphics3D[spheres] 

Mathematica graphics

Graphics3D[spheres] /. s_Sphere :> Sequence[RGBColor[RandomReal[{0, 1}, 3]], s] 

Mathematica graphics

Repeated evalutation will yield individual coloring.

Not very effective, but useful if you go for postprocessing of existing Graphics primitives:

spheres = Sphere[#[[1 ;; 3]], #[[4]]/2] & /@ RandomReal[{-1, 1}, {10, 4}]; Graphics3D[spheres] 

Mathematica graphics

Graphics3D[spheres] /. s_Sphere :> Sequence[RGBColor[RandomReal[{0, 1}, 3]], s] 

Mathematica graphics

Repeated evalutation will yield individual coloring.

Source Link
Yves Klett
  • 15.7k
  • 5
  • 59
  • 134

Not very effective, but useful if you go for postprocessing existing Graphics primitives:

spheres = Sphere[#[[1 ;; 3]], #[[4]]/2] & /@ RandomReal[{-1, 1}, {10, 4}]; Graphics3D[spheres] 

Mathematica graphics

Graphics3D[spheres] /. s_Sphere :> Sequence[RGBColor[RandomReal[{0, 1}, 3]], s] 

Mathematica graphics

Repeated evalutation will yield individual coloring.