Created
May 7, 2022 04:46
-
-
Save RH2/c8bb40b75c901c9bf486cfda40cf362b to your computer and use it in GitHub Desktop.
trig.vfl
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
float fovx; //field of view in X - | |
float fovy; //field of view in Y - | |
float aperature_x; //aperture in X 41.4214 | |
float aperature_y; //aperture in Y - | |
float focal; //focal length 50 | |
float resx; //pixel resolution in X 320 | |
float resy; //pixel resolution in Y 243 | |
float pixel_aspect; //pixel aspect (width/height) | |
//custom declarations | |
fovx = @f; | |
fovy = 0; | |
aperature_x = 1; | |
aperature_y = 1; | |
focal length = 1; | |
resx = @dimx; | |
resy = @dimy; | |
pixel_aspect = resx/resy; | |
fovx = 2 * atan( (aperature_x/2) / focal ) | |
//tan(fovy/2) = (aperature_y/2) / focal | |
aperature_x/aperature_y = (resx * pixel_aspect) / resy | |
aperature_y = (resy*aperature_x) / (resx*pixel_aspect) | |
fovy = 2*atan( (aperature_y/2) / focal ) | |
fovx = 2*atan( ( aperature_x / 2 ) / focal ) | |
aperature_y = (resy * aperature_x) / (resx * pixel_aspect) | |
fovy = 2*atan( (aperature_y/2) / focal ) | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment