# Outputting a set of graphics 3D objects with positions defined by one array and colors by another? [duplicate]

I have a set of 2- or 3-space coordinates in an array, $(v_1,...,v_N)$, and an array of RGB color values (outputs from ImageValue[]) for each coordinate, $(c_1,...,c_N)$. How can I output a graphics3D image where I have, say, spheres at each coordinate $v_i$ with an associated color $c_i$?

For an example with two coordinates, I might have a coordinate array {{0,10,0}, {20,30,0}} and a color array {{0.529412, 0.529412, 0.529412}, {0.647059, 0.647059, 0.647059}}. I'd ideally like to be able to output two spheres are positions {{0,10,0}, {20,30,0}} in 3-space, where the first sphere has RGB value {0.529412, 0.529412, 0.529412} and the second sphere has RGB value {0.647059, 0.647059, 0.647059}.

-

## marked as duplicate by J. M.♦May 9 '13 at 1:57

Well, you didn't initially specify how your colors were formatted. I've now written an answer. – J. M. May 9 '13 at 0:49
@J.M. Very good, thank you! – QuadraticU May 9 '13 at 0:50

Graphics3D[MapThread[{RGBColor @@ #1, Sphere[#2, 1]} &,
{{{0.529412, 0.529412, 0.529412}, {0.647059, 0.647059, 0.647059}},
{{0, 10, 0}, {20, 30, 0}}}], Lighting -> "Neutral"]


But, if you can, why not stick to two dimensions?

Graphics[MapThread[{RGBColor @@ #1, Disk[Most[#2], 1]} &,
{{{0.529412, 0.529412, 0.529412}, {0.647059, 0.647059, 0.647059}},
{{0, 10, 0}, {20, 30, 0}}}]]


-