fix camera bug
This commit is contained in:
parent
86e7637e2e
commit
420701855e
|
@ -22,8 +22,14 @@ export function initMatrices(gl: any, params: any) {
|
||||||
zFar);
|
zFar);
|
||||||
|
|
||||||
const viewMatrix = mat4.create();
|
const viewMatrix = mat4.create();
|
||||||
|
const xAxis = mat4.create();
|
||||||
mat4.rotateY(viewMatrix, viewMatrix, params.camRot.y);
|
mat4.rotateY(viewMatrix, viewMatrix, params.camRot.y);
|
||||||
mat4.rotateX(viewMatrix, viewMatrix, params.camRot.x);
|
mat4.rotateY(xAxis, xAxis, params.camRot.y);
|
||||||
|
mat4.rotate(viewMatrix, viewMatrix, params.camRot.x, [
|
||||||
|
xAxis[0],
|
||||||
|
xAxis[4],
|
||||||
|
xAxis[8],
|
||||||
|
]);
|
||||||
mat4.translate(
|
mat4.translate(
|
||||||
viewMatrix,
|
viewMatrix,
|
||||||
viewMatrix,
|
viewMatrix,
|
||||||
|
|
Loading…
Reference in New Issue