0

I'm looking for code to animate smooth transition between 2 viewpoints with ViewProjection -> "Orthographic". My first attempt is below but it's missing some scale invariance.

  • Where should I set PlotRange? Currently the only object that sets PlotRange is graph, but this setting seems to get lost in the pipeline

  • How do I enforce AspectRatio to be 1?

enter image description here

th = Thickness[0.0015];
arrows = Graphics3D[{Arrowheads[0.02], th, 
    Arrow[{{1, 0, 0}, {-1, 0, 0}}], Arrow[{{0, 0, -1}, {0, 0, 1}}], 
    Arrow[{{0, 1, 0}, {0, -1, 0}}]}];
plane = Plot3D[0, {x, -1, 1}, {y, -1, 1}, PlotStyle -> None, 
   Mesh -> 5, MeshStyle -> Directive[Thickness[.001], Opacity[.2]], 
   BoundaryStyle -> Directive[th, Opacity[.2]]];

graph = Plot3D[{2/([Pi] Sqrt[(1 + x - y) (1 - x + y)]), 0}/ 10, {x, -1, 1}, {y, -1, 1}, RegionFunction -> Function[{x, y}, 0.9 <= x + y <= 1 && -1 <= x - y <= 1], PlotRange -> {{-1, 1}, {-1, 1}, {0, .5}}, Filling -> 0, FillingStyle -> Yellow, Mesh -> None, PlotPoints -> 50, BoundaryStyle -> th, AspectRatio -> 1, Axes -> None, Boxed -> False]; graphic3d = Show[arrows, plane, graph];

animateTransition[object_, t_, point1_, point2_] := Module[{}, angle = t*[Pi]/2; Show[graph, arrows, plane, ViewPoint -> point1Cos[angle] + point2Sin[angle], ViewProjection -> "Orthographic"] ]; (* to get initial direction use
https://mathematica.stackexchange.com/questions/132228/how-to-obtain-
the-viewpoint/132231 *) startDirection = {1.17091, -2.65552, 1.73988}; endDirection = {-1, -1, 0}; pics = Table[ animateTransition[graphic3d, t, startDirection, endDirection], {t, 0, 1, .1}]; ListAnimate[pics]

Jagra
  • 14,343
  • 1
  • 39
  • 81
Yaroslav Bulatov
  • 7,793
  • 1
  • 19
  • 44
  • Version 12.3.1.0 running your exact code on macOS doesn't appear to replicate you problem. It looks fine. – Jagra Jul 30 '21 at 14:23
  • 2
    Getting rid of the ViewProjection option and faking orthographic with a far away ViewPoint seems to fix things. e.g.ViewPoint -> (100 (point1*Cos[angle] + point2*Sin[angle])). – Greg Hurst Jul 30 '21 at 14:23
  • The problem seems to caused by SphericalRegion->Automatic. Changing it to True removes the weird box jittering – Yaroslav Bulatov Aug 04 '21 at 12:31

0 Answers0