mirror of
https://github.com/Rezmason/matrix.git
synced 2026-04-18 14:19:30 -07:00
Swapping the camera perspective generating function to mat4.perspectiveZO.
This commit is contained in:
@@ -114,7 +114,7 @@ export default async (canvas, config) => {
|
|||||||
const updateCameraBuffer = () => {
|
const updateCameraBuffer = () => {
|
||||||
const canvasSize = canvasConfig.size;
|
const canvasSize = canvasConfig.size;
|
||||||
const aspectRatio = canvasSize[0] / canvasSize[1];
|
const aspectRatio = canvasSize[0] / canvasSize[1];
|
||||||
mat4.perspective(camera, (Math.PI / 180) * 90, aspectRatio, 0.0001, 1000);
|
mat4.perspectiveZO(camera, (Math.PI / 180) * 90, aspectRatio, 0.0001, 1000);
|
||||||
const screenSize = aspectRatio > 1 ? [1, aspectRatio] : [1 / aspectRatio, 1];
|
const screenSize = aspectRatio > 1 ? [1, aspectRatio] : [1 / aspectRatio, 1];
|
||||||
queue.writeBuffer(cameraBuffer, 0, new Float32Array([...screenSize, /* ??? */ -1, -1, ...camera, ...transform]));
|
queue.writeBuffer(cameraBuffer, 0, new Float32Array([...screenSize, /* ??? */ -1, -1, ...camera, ...transform]));
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user