r3-legacy/bak/r3-d3-api-camera-stereo-ana...

82 lines
2.6 KiB
JavaScript

/**
* R3.D3.API.Camera.Stereo.Anaglyph
* @constructor
* @param apiStereoCamera
* @param colorMatrixLeft
* @param colorMatrixRight
* @param orthographicCamera
* @param orthographicScene
*/
R3.D3.API.Camera.Stereo.Anaglyph = function(
apiStereoCamera,
colorMatrixLeft,
colorMatrixRight,
orthographicCamera,
orthographicScene,
renderTargetL,
renderTargetR,
shaderMaterial,
meshPlane
) {
if (R3.Utils.UndefinedOrNull(apiStereoCamera)) {
apiStereoCamera = {
stereoType : R3.D3.API.Camera.Stereo.STEREO_MODE_ANAGLYPH
};
}
if (R3.Utils.UndefinedOrNull(apiStereoCamera.stereoType)) {
apiStereoCamera.stereoType = R3.D3.API.Camera.Stereo.STEREO_MODE_ANAGLYPH;
}
if (R3.Utils.UndefinedOrNull(colorMatrixLeft)) {
colorMatrixLeft = [
1.0671679973602295, -0.0016435992438346148, 0.0001777536963345483, // r out
-0.028107794001698494, -0.00019593400065787137, -0.0002875397040043026, // g out
-0.04279090091586113, 0.000015809757314855233, -0.00024287120322696865 // b out
]
}
this.colorMatrixLeft = colorMatrixLeft;
if (R3.Utils.UndefinedOrNull(colorMatrixRight)) {
colorMatrixRight = [
-0.0355340838432312, -0.06440307199954987, 0.018319187685847282, // r out
-0.10269022732973099, 0.8079727292060852, -0.04835830628871918, // g out
0.0001224992738571018, -0.009558862075209618, 0.567823588848114 // b out
]
}
this.colorMatrixRight = colorMatrixRight;
if (R3.Utils.UndefinedOrNull(orthographicCamera)) {
orthographicCamera = new R3.D3.API.Camera.Orthographic(null, null, 0, 1, -1, 1, 1, -1);
}
this.orthographicCamera = orthographicCamera;
if (R3.Utils.UndefinedOrNull(orthographicScene)) {
orthographicScene = new R3.D3.API.Scene(null, 'Orthographic Stereo Anaglyph Scene');
}
this.orthographicScene = orthographicScene;
//
// if (R3.Utils.UndefinedOrNull(renderTargetL)) {
// renderTargetL = new R3.D3.API.RenderTarget(null, null, null, )
// }
//
// renderTargetL,
// renderTargetR,
// shaderMaterial,
// meshPlane
R3.D3.API.Camera.Stereo.call(
this,
apiStereoCamera,
apiStereoCamera.stereoType,
apiStereoCamera.eyeSep,
apiStereoCamera.main,
apiStereoCamera.cameraL,
apiStereoCamera.cameraR
);
};
R3.D3.API.Camera.Stereo.Anaglyph.prototype = Object.create(R3.D3.API.Camera.Stereo.prototype);
R3.D3.API.Camera.Stereo.Anaglyph.prototype.constructor = R3.D3.API.Camera.Stereo.Anaglyph;