# Translate (and scale) AnatomyData in three-dimensions

I would like to create a Graphics3D entity consisting of a human eyeball and a complex figure defined elsewhere. (For a minimal working example, assume that the other object is a Sphere[].) I need to adjust (transform) the position of the eyeball (not of the other components).

Creating the eyeball is straightforward:

eyeball =
Show[
Entity["AnatomicalStructure", "RightEyeball"]["Graphics3D"],
ViewPoint -> {-1, -.6, 0}]


I can put the eyeball and sphere in the same Graphics3D by:

Show[eyeball, Graphics3D[Sphere[]]]


Alas, they do not have the proper relative positions (of course).

I can also simply translate the Sphere.

But because my full graphics has lots of components that are carefully arranged, I need to translate just the eyeball. I have tried all manner of

Graphics3D[GeometricTransformation[eyeball,
TranslationTransform[{5, 5, 5}]]]


and so forth, without success.

How can I move (in three dimensions) the eyeball to place it wherever I want in a large, complex Graphics3D environment that contains other elements?

• for translation you can use Graphics3D[GeometricTransformation[Sphere[], TranslationTransform[Mean/@PlotRange[eyeball]]]]. – kglr Jul 18 '19 at 1:16
• @kglr: That's useful--and close--but not quite what I need. I do not want to translate the Sphere, as I mentioned. There must be some way to translate just the eyeball. Instead, I merely want to translate the eyeball. Moreover, I do not want to translate it to the mean of the other object... it has to be set at a very special position. – David G. Stork Jul 18 '19 at 1:19
• how about Graphics3D[{GeometricTransformation[eyeball[[1]], RescalingTransform[PlotRange@eyeball, {{-1, 1}, {-1, 1}, {-1, 1}}]]}, Axes->True]? – kglr Jul 18 '19 at 1:42
• @kglr: Nope. You've rescaled the eyeball, but not translated it. There must be something about the internal representation of the AnatomyData the prevents the objects from being translated... no? – David G. Stork Jul 18 '19 at 1:47
• David, RescalingTransform does both translation and scaling: "Rescaling transformation is a composition of scaling and translation". More generally, you can use RescalingTransform[PlotRange@eyeball, PlotRange[Graphics3D[Sphere[]]]]] (replace Sphere[] with your 3D primitives). – kglr Jul 18 '19 at 1:53

You can try

GeometricTransformation[eyeball[[1]],
TranslationTransform[{x0, y0, z0} - Mean /@ (PlotRange @ eyeball) ]]


to translate the center of eyeball to {x0, y0, z0}.

Manipulate[Graphics3D[{{Red, Sphere[]}, PointSize[Large], Point[{x0, y0, z0}],
Opacity[.2],
GeometricTransformation[eyeball[[1]],
TranslationTransform[{x0, y0, z0} - Mean /@ (PlotRange @ eyeball) ]]},
Axes -> True, AxesOrigin -> {x0, y0, z0}, ImageSize -> 400],
{{x0, -5}, -10, 10, LabeledSlider},
{{y0, 7}, -10, 10, LabeledSlider},
{{z0, -3}, -10, 10, LabeledSlider}]


• There. Thanks. ($\checkmark$) – David G. Stork Jul 18 '19 at 3:07