您的位置:首页 > 大数据 > 人工智能

How to get the Projection ProjectionMatrixFromCameraIntrinsics

2017-06-16 16:16 495 查看
ProjectionMatrixForCameraIntrinsics(float width, float height, float fx, float fy,float cx, float cy,  float near, float far) {
const float xscale = near / fx;
const float yscale = near / fy;

const float xoffset = (cx - (width / 2.0)) * xscale;

const float yoffset = -(cy - (height / 2.0)) * yscale;

return glm::frustum(xscale * -width / 2.0f - xoffset,
xscale * width / 2.0f - xoffset,
yscale * -height / 2.0f - yoffset,
yscale * height / 2.0f - yoffset, near, far);
}
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息