Suppose I want to demnstrate two ellispoids; one with the center at the origin and the other translated.
After the advice I got in the last question I use
ellipse3D[centre_: {0, 0, 0}, radii_: {1, 1}, normal_: {0, 0, 1}] :=
Polygon[RotationTransform[{{0, 0, 1}, normal}, centre][
Map[Append[#, Last@centre] &][
SortBy[#, N[ArcTan @@ (# - Most@centre)] &] &[
MeshCoordinates[
BoundaryDiscretizeRegion[Ellipsoid[Most@centre, radii]]]]]]]
arrowAxesXYZ[{a_, b_, c_}] :=
Map[Arrow[Tube[{{0, 0, 0}, #}]] &, {a + 2, b + 2,
c + 2} IdentityMatrix[3]]
AxesXYZ[{a_, b_, c_}] := {Text[
Style["X", 20, Italic], {a + 2.2, 0, 0}],
Text[Style["Y", 20, Italic], {0, b + 2.2, 0}],
Text[Style["Z", 20, Italic], {0, 0, c + 2.2}]}
EllipsoidXYZ[{a_, b_, c_}] := {{Specularity[White, 40], Opacity[0.5],
Ellipsoid[{0, 0, 0}, {a, b, c}]}, {Gray, Opacity[1],
EdgeForm[None], ellipse3D[{0, 0, 0}, {c, b}, {1, 0, 0}],
ellipse3D[{0, 0, 0}, {a, c}, {0, 1, 0}],
ellipse3D[{0, 0, 0}, {a, b}, {0, 0, 1}]}}
translatedEllipsoidXYZ[{a_, b_, c_}, {d_, e_, f_}] :=
Translate[EllipsoidXYZ[{a, b, c}], {d, e, f}]
translateAxesXYZ[{a_, b_, c_}, {d_, e_, f_}] :=
Translate[arrowAxesXYZ[{a, b, c}], {d, e, f}]
vectorofTranslation[{d_, e_, f_}] := {Gray,
Arrow[Tube[{{0, 0, 0}, {d, e, f}}, 0.05]]}
Show[Graphics3D[{EllipsoidXYZ[{10, 3, 2}], arrowAxesXYZ[{10, 3, 2}],
AxesXYZ[{10, 3, 2}],
translatedEllipsoidXYZ[{10, 3, 2}, {15, 7, 4}],
translateAxesXYZ[{10, 3, 2}, {15, 7, 4}],
vectorofTranslation[{15, 7, 4}]}], ImageSize -> 600]
taking
My question is how can someone modify this output? Saying for instance that we want
a) Get rid of the cross sections of the translated ellipsoid.
b) Modify the opacity of the translated ellipsoid.
c) Modify the apppearance of the translated axis.
I could add arguments in the definitions but I am wondering how in general we can modify a complex graphics3D after its creation.
If you are lost in the various definitions, it suffices to me a minimal example of "how-to-approach".
Manipulate
and have all of these as options, check boxes and sliders $\endgroup$Manipulate
. $\endgroup$