4
$\begingroup$

I want to draw a cube with a specific opacity and an Image placed inside it. My plan was to use those cubes as building blocks of a 3 dimensional representation of a 3 rank tensor ( more or less like this http://staff.itee.uq.edu.au/janetw/cmc/chapters/Hebbian/ten3.gif).

I can easily draw the cubes in the right spots but placing the images inside them is beyond my ability. how can I achieve the result I want?

$\endgroup$
  • $\begingroup$ There was a useful question about placing text in fixed positions in 3d in a non-rotating manner, and taking into account the distance from the observer, but I cannot find it :( $\endgroup$ – corey979 Nov 6 '16 at 9:46
  • $\begingroup$ damn :-(. if i could insert a plane in the cuboid and draw the 2d image on that plane i could use this trick to solve the problem $\endgroup$ – Alucard Nov 6 '16 at 14:38
  • $\begingroup$ Why not to use something like Graphics3D[Cuboid /@ Position[BoxMatrix[All, {5, 5, 5}], 1]]? Do you really need Raster? $\endgroup$ – Alexey Popkov Nov 7 '16 at 21:02
  • $\begingroup$ well i need to place numbers on the boxes and make them transparent otherwise i can't see the numbers in the central part of the cube $\endgroup$ – Alucard Nov 7 '16 at 23:09
5
$\begingroup$

Try to use something like this:

g1 = Graphics3D[{Opacity[0.02], 
    Map[Cuboid, Position[BoxMatrix[All, {5, 5, 5}], 1]]}];
pos1 = Position[BoxMatrix[All, {5, 5, 5}], 1];
pos2 = ({0, .75, .25} + #) & /@ pos1;
g2 = Graphics3D[{Text["A", #] & /@ pos2}];
Show[{g1, g2}]

enter image description here

| improve this answer | |
$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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