Given a direction vector $w$ and some angle $\theta$, then what does $\frac{1}{\tan(\theta/2)}w$ do?

57 Views Asked by At

Given a direction vector $w$ ($w$ refers to the $w$ in $u,v,w,$ however it's not necessarily perpendicular to $u,v$) and some angle $\theta$, then what does $\frac{1}{\tan(\theta/2)} w$ do?

I saw this appear in the context of ray-tracing:

enter image description here

I also found a description where

$$\tan\left(\frac\theta2\right)= \text{yres}\cdot \frac{\text{pixel height}} 2$$

which I read that by taking $\frac{1}{\tan(\theta/2)} w$ one cancels out the $y$ component (of screen resolution?)? And then gets $2w$ without $y$-component back?

https://pdfs.semanticscholar.org/presentation/3273/5c4af85b6c0ae94c867caeb68b2a1f7182f0.pdf

So does that mean that one makes $w$ (as given in the notes above) point directly perpendicular relative to the screen plane? When it used to be angled?

1

There are 1 best solutions below

5
On

We have that for $\theta \neq k\pi$

  • $k=\frac{1}{\tan(\theta/2)} $

is a real number and the product

  • $\frac{1}{\tan(\theta/2)} \vec v=k \vec v$

represent the product of a vector by a scalar that is a scaled vector with the same direction of $\vec v$.

Reading your material it seems that $\vec v$ is a coordinate vector (in vertical direction) and the full expression

  • $Eye+\vec w-(xres/2)\cdot PixelWidth\cdot \vec u +(yres/2)\cdot PixelHeight\cdot \vec v$

simply refer to the coordinates of the upper left corner of the screen.

In that context the product

  • $(yres/2)\cdot PixelHeight\cdot \vec v= \tan(\theta_y /2)\cdot \vec v$

is the vertical component of the corner with respect to the center of the screen.