I hope I am not doing something wrong.
Compare the following figures.
1) Ellipsoid
Graphics3D[{{Specularity[White, 40], Opacity[0.5],
Ellipsoid[{0, 0, 0}, {10, 3, 2}]}, {Opacity[1],
Ellipsoid[{0, 0, 0}, {0, 3, 2}], Ellipsoid[{0, 0, 0}, {10, 0, 2}],
Ellipsoid[{0, 0, 0}, {10, 3, 0}]}}, ImageSize -> Large]
2) The same goal but in a more "user-defined" way
Graphics3D[{Specularity[White, 40], Opacity[0.5],
Scale[#, {10, 3, 2}], {Opacity[1], Scale[#, {.001, 3, 2}],
Scale[#, {10, 0.001, 2}], Scale[#, {10, 3, 0.001}]}} &@Sphere[],
ImageSize -> Large]
Why the quality of the first Graphics3D
is so bad?
$Version
(*"10.3.0 for Linux x86 (64-bit) (October 9, 2015)"*)
Answer
The problem with the first graphic is that you are trying to create a 3D object with exactly zero width in one dimension. In the second graphic, you make the width in that dimension equal to a small value. This same workaround can be applied to the Ellipsoid
call,
Graphics3D[{{Specularity[White, 40], Opacity[0.5],
Ellipsoid[{0, 0, 0}, {10, 3, 2}]},
{Opacity[1],
Ellipsoid[{0, 0, 0}, {0.001, 3, 2}],
Ellipsoid[{0, 0, 0}, {10, 0.001, 2}],
Ellipsoid[{0, 0, 0}, {10, 3, 0.001}]}}, ImageSize -> Large]
Thanks to shrx for pointing out a better way to do this, as shown in in this post by Taiki. Using the function ellipse3D[center,{r1,r2},normal]
, which takes as argument the center position, the two semiaxes, and the normal vector to the plane, we get
Graphics3D[{{Specularity[White, 40], Opacity[0.5],
Ellipsoid[{0, 0, 0}, {10, 3, 2}]},
{Opacity[1], EdgeForm[None],
ellipse3D[{0, 0, 0}, {2, 3}, {1, 0, 0}],
ellipse3D[{0, 0, 0}, {10, 2}, {0, 1, 0}],
ellipse3D[{0, 0, 0}, {10, 3}, {0, 0, 1}]}}, ImageSize -> Large]
giving an identical looking result which, as halirutan says, will behave better in the long run.
Comments
Post a Comment