Separate renderer into own folder

This commit is contained in:
2026-03-11 10:05:43 -03:00
parent d753cf4364
commit 054125bc32
28 changed files with 601 additions and 21 deletions
+24
View File
@@ -0,0 +1,24 @@
export function perspective(out: Float32Array, fov: number, aspect: number, near: number, far: number) {
const f = 1 / Math.tan(fov / 2);
const nf = 1 / (near - far);
out[0] = f / aspect;
out[1] = 0;
out[2] = 0;
out[3] = 0;
out[4] = 0;
out[5] = f;
out[6] = 0;
out[7] = 0;
out[8] = 0;
out[9] = 0;
out[10] = (far + near) * nf;
out[11] = -1;
out[12] = 0;
out[13] = 0;
out[14] = (2 * far * near) * nf;
out[15] = 0;
}