4

I am trying to create a sphere in pgfplots 3D but creating a smooth sphere is computationally expensive and Overleaf does not have sufficient rendering time in order for such a large sampling calculation. To work around this I want to generate a 3D circle that exactly matches the boundary of the sphere along the projected viewing angle. However, I am unable to find any instances of what this exact viewing angle is so I cannot progress, and I do not wish to use trial and error.

  • The orthographic projection of a sphere with center C is always a circle of the same radius, regardless of the view angles. –  Sep 25 '19 at 14:57
  • The sphere does not render fast enough due to the massive computational increase when moving from 2D to 3D plots. Hence I hack around this by setting the sample rate of the sphere sufficiently low that it renders and then summoning a circle that exactly fits the sphere boundary from the given viewing angle. – Jack Tiger Lam Sep 25 '19 at 14:59
  • Why don't you just shade a circle appropriately like in this great answer? There are so many circle shadings on the market, and then the computational efforts will go to the graphics card. –  Sep 25 '19 at 15:02

1 Answers1

7

Unless I'm mistaken it's in the pgfplots manual, Section 4.11 "3D Axis Configuration" under "View Configuration:

4.11.1 View Configuration

/pgfplots/view={azimuth}{elevation} (initially {25}{30})

Changes both view angles of a 3D axis. The azimuth (first argument) is the horizontal angle which is rotated around the z-axis. For a 3D plot, the z-axis always points to the top. The elevation (second argument) is the vertical rotation around the (rotated) x-axis. Positive elevation values indicate a view from above, negative a view from below. All values are measured in degree (but see trig format).

Fritz
  • 6,273
  • 31
  • 55