[BUGFIX] Fix zoom for perspective lens, partially fix Issue #1279

#2381 Merged at 0f30249
Repository
jisuoqing
Branch
yt
Repository
yt_analysis
Branch
yt
Author
  1. Suoqing Ji
Reviewers
Description

After this fix, cam.width[2] will remain unchanged when zooming is performed.

  • This PR does not affect plane-parallel-lens, since only width[0] and width[1] will take effect of plane-parallel-lens.

  • For perspective-lens, width defines the open angle of the camera, while adding a factor to all three components of width does not change the open angle at all. So keep width[2] unchanged and change width[0] and width[1] will make zooming work properly.

  • For spherical-lens, this PR prevents a potential bug, since there's no zooming option for spherical-lens, and changing width[2] for spherical-lens will incorrectly alter the length of rays. In addition, spherical-lens does not make use of width[0] and width[1], thus this PR is also safe for spherical-lens.

Comments (0)