# How do I draw multiple 3D shapes defined by lists of points?

I'm attempting to draw $N$ cones on a 3D object, where each cone is specified by a pair of 3D coordinates. The first coordinate is for the cone's base, the second one for the cone's apex. Here, I have two lists - ConeBases and ConeVertices - where cone $k$ is specified by the pair of coordinates at the $k$th positions of the ConeBases and ConeVertices lists (i.e. ConeBases[[k]] and ConeVertices[[k]]).

To specify a single cone of base radius (ConeRadius = 1), we can write:

ConeRadius=1;
Graphics3D[Cone[{{0, 0, 0}, {0, 0, 1}}, ConeRadius]]


However, how could I automatically generate the $N$ cones using my lists of base and apex coordinates? What if I also had a list of base radii for the cones?

The naive solution here, which is what I've been doing, is to generate a string individually specifying each cone. Is there a better way to proceed?

-

You might try something like this:

ConeBases = RandomReal[{-1, 1}, {20, 3}];
ConeVertices = RandomReal[{-1, 1}, {20, 3}];
ConeRadii = RandomReal[{0, .3}, {20}];

cones = Transpose[{ConeBases, ConeVertices, ConeRadii}]

Graphics3D[Cone[{#[[1]], #[[2]]}, #[[3]]] & /@ cones]


-
Or cones = Transpose[{Transpose@{ConeBases, ConeVertices}, ConeRadii}]; Graphics3D[Cone @@@ cones] – Dr. belisarius Mar 5 '13 at 11:02
Or Graphics3D[MapThread[Cone[{#1, #2}, #3] &, {ConeBases, ConeVertices, ConeRadii}]] – einbandi Mar 5 '13 at 16:30