0
|
7201 Views
|
2 Replies
|
0 Total Likes
View groups...
Share
GROUPS:

# How to colour random 3D points in a stereographic view

Posted 10 years ago
 I am trying to produce stereographic pics which give the impression of depth when viewed with the crossed-eye view technique. Basically I put two 2D projections of the 3D object next to each other, projected with two slightly different viewing angles. A piece of a code yielding such a double plot, showing particles randomly placed in space, reads like this: pts = Table[ Point[{RandomReal[], RandomReal[], RandomReal[]}], {20}]; TableView[ Show[Graphics3D[{PointSize[0.05], pts}, ImageSize -> 300, ViewPoint -> {2, -3.3, 2.5}]], Show[Graphics3D[{PointSize[0.05], pts}, ImageSize -> 300, ViewPoint -> {2, -3.5, 2.5}]]]  The result looks as My question is: how can I choose a different colour for each point (in any way, either randomly or systematically) so that each point has a different colour in one figure, but each of them has the same colour in the second plot as in the first? Imre Pazsit
2 Replies
Sort By:
Posted 10 years ago
 Thanks - this is perfect! Exactly what I was looking for. Works beautifully.
Posted 10 years ago
 With Mathematica 10 you can give each point a color of its own with pts = Table[{RandomColor[], Point[{RandomReal[], RandomReal[], RandomReal[]}]}, {20}];In earlier version you may have to type a little more: pts = Table[{RGBColor[RandomReal[], RandomReal[], RandomReal[]], Point[{RandomReal[], RandomReal[], RandomReal[]}]}, {20}];