microsoft / microsoft/TRELLIS

Why is the relationship between FOV (Field of View) and radius in data rendering expressed using sin ⁡ sin instead of tan ⁡ tan?

Open
#242 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Python
Stars
13.7k
Forks
1.3k
PR merge metrics
No merged PRs in 30d

Description

Thank you for your efforts, but I have a question. In render_cond.py, why is the relationship between FOV (Field of View) and radius in data rendering expressed using sin instead of tan?
I tried using the tangent function, but I noticed that part of the rendered image extends beyond the canvas. Could you explain why this is happening? I believe the formula should represent the correct relationship with the tangent. If there is any mistake, I would appreciate your correction.

fov_min, fov_max = 10, 70
radius_min = np.sqrt(3) / 2 / np.sin(fov_max / 360 * np.pi)
radius_max = np.sqrt(3) / 2 / np.sin(fov_min / 360 * np.pi)
k_min = 1 / radius_max**2
k_max = 1 / radius_min**2
ks = np.random.uniform(k_min, k_max, (1000000,))
radius = [1 / np.sqrt(k) for k in ks]
fov = [2 * np.arcsin(np.sqrt(3) / 2 / r) for r in radius]

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Read render_cond.py and the displayed Python/NumPy calculation first. Trace how FOV, radius, and canvas bounds are used, then compare the sine and tangent formulations against the reported rendered-image behavior. Done means documenting the geometric reason and correcting the formula if the repository confirms an error.

Written by the indexing model from the issue text.

Assessment

Tech stack
numpy, python
Domain
computer-graphics
Issue type
Documentation
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.