Mathematica: text in Graphics3D relative to image coordinates

The Mathematica documentation states: "Text in three-dimensional graphics is placed at the position corresponding to the projection of the specified point {x, y, z}. The text is drawn in front of all other objects." How do you place text relative to image size?

Here's how to do it in 2D:

custumLabels = Graphics[{ Text[Style["A", Red, Bold, 18], ImageScaled[{0.025, .95}]], Text[Style["B", Red, Bold, 18], ImageScaled[{0.95, .05}]]} ]; Framed[Show[ Plot[ Sin[x] Exp[x], {x, 0, 10}, Frame -> True, PlotRangeClipping -> False, FrameLabel -> {"x", "y"} ], custumLabels ], FrameMargins -> 0] 

Output

These labels will always be displayed in this position while PlotRangeClipping set to False . The question is, how do you create these labels in this particular position if I switch to Graphics3D . Try it with a simple one.

 Framed[Show[ Graphics3D[{Sphere[{0, 0, 0}, 1]}] ], FrameMargins -> 0] 
+6
source share
1 answer

Epilog and Prolog in 3D use a scaled 2D coordinate system (for all primitives):

 Graphics3D[{Sphere[]}, Epilog -> Text["abcdef", Scaled[{0.1, 0.1}]]] 

enter image description here

+6
source

Source: https://habr.com/ru/post/890448/


All Articles