Untitled
unknown
plain_text
a month ago
397 B
6
Indexable
Never
// 1.04719755 is 60 deg in rad - FOV // 0.523598776 half fov // ray angle relative to world const rayDirection = 1.04719755 * (Math.floor(0.5 * RES_X) - i) / (RES_X - 1); // a value between 0.5 and -0.5 const rayProjectionPos = (0.5 * Math.tan(rayDirection)) / Math.tan(0.523598776); //actual ray column in projection ray.col = Math.round(RES_X * (0.5 - rayProjectionPos)) + 1;
Leave a Comment