mirror of
https://github.com/status-im/react-native.git
synced 2025-02-05 06:04:15 +00:00
Fix the perspective projection
Reviewed By: kukulski Differential Revision: D2907261 fb-gh-sync-id: 3954b015ece9c4339a674c4fcc2c2c7187b6da41 shipit-source-id: 3954b015ece9c4339a674c4fcc2c2c7187b6da41
This commit is contained in:
parent
194092e729
commit
843b556769
@ -67,8 +67,14 @@ var MatrixMath = {
|
||||
];
|
||||
},
|
||||
|
||||
/**
|
||||
* This create a perspective projection towards negative z
|
||||
* Clipping the z range of [-near, -far]
|
||||
*
|
||||
* @param fovInRadians - field of view in randians
|
||||
*/
|
||||
createPerspective: function(fovInRadians, aspect, near, far) {
|
||||
var h = 1 / Math.tan(fovInRadians);
|
||||
var h = 1 / Math.tan(fovInRadians / 2);
|
||||
var r_depth = 1 / (near - far);
|
||||
var C = (far + near) * r_depth;
|
||||
var D = 2 * (far * near * r_depth);
|
||||
|
Loading…
x
Reference in New Issue
Block a user