[SOLVED] How to use camera.calculateProjection properly?

Hi all, I am trying to implement an oblique frustum, And after reading the docs, I wrote the following code:

this.entity.camera.calculateProjection = function(mat, typeView) {
    mat = new pc.Mat4(1, 2, 3, 4, 5, 6, 7, 8, 9, 1, 2, 3, 4, 5, 6, 7);
    return mat;
};

I know the value used to creat a projection matrix is not correct,
just want to know how can I affect the projection matrix used by the engine
And none the above codes is working, i.e the camera still render the “old” image as if the projection matrix hasn’t been modified

You’d write your matrix to the mat argument for your calculateProjection function. So in your case, you’d do:

this.entity.camera.calculateProjection = function(mat, typeView) {
    mat.set([1, 2, 3, 4, 5, 6, 7, 8, 9, 1, 2, 3, 4, 5, 6, 7]);
};
2 Likes