Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- CL3D.CameraSceneNode.prototype.setOrthogonal = function(mode) {
- this.orthogonal = mode;
- this.recalculateProjectionMatrix();
- }
- CL3D.CameraSceneNode.prototype.recalculateProjectionMatrix = function () {
- if (this.orthogonal) this.Projection.buildProjectionMatrixOrthogonalFovLH(this.Fovy, this.Aspect, this.ZNear, this.ZFar);
- else this.Projection.buildProjectionMatrixPerspectiveFovLH(this.Fovy, this.Aspect, this.ZNear, this.ZFar);
- };
- CL3D.Matrix4.prototype.buildProjectionMatrixOrthogonalFovLH = function (e, d, f, c) {
- var b = (20 / Math.tan(e / 2));
- var a = (b / d) * 5 / 3;//25;
- this.m00 = 2 / a;
- this.m01 = 0;
- this.m02 = 0;
- this.m03 = 0;
- this.m04 = 0;
- this.m05 = 2 / b;
- this.m06 = 0;
- this.m07 = 0;
- this.m08 = 0;
- this.m09 = 0;
- this.m10 = (1 / (c - f));
- this.m11 = 0;
- this.m12 = 0;
- this.m13 = 0;
- this.m14 = f / (f - c);
- this.m15 = 1;
- this.bIsIdentity = false;
- };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement