立体和虚拟相机设置
我想知道你们中是否有人知道如何从一个简单的相机矩阵计算两个相机矩阵(左和右)?为了产生立体效果(模拟人的双眼)。
感谢您的帮助。
I would like to know if any of you, knows a way to compute two camera matrices (left and right) from a simple camera matrix? In order to have a stereoscopic effect (simulating both eyes of a human being).
Thanks for your help.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您所需要做的就是将每个摄像机稍微向当前摄像机的左侧和右侧移动,其中“左”和“右”由摄像机的视图方向定义。
考虑到主摄像头的矩阵,您只需将立体摄像头偏移两眼之间距离的一半即可。在伪代码中:
其中
leftMatrix
和rightMatrix
最初是主相机矩阵的副本。您可能需要交换 +/-,具体取决于您希望模型出现在屏幕前面还是后面。All you need to do is move each camera slightly to the left and right of the current camera where "left" and "right" are defined by the camera's view direction.
Given the matrix of the main camera you just need to offset the stereo cameras by half the distance between the eyes. In pseudo code:
Where
leftMatrix
andrightMatrix
are originally copies of the main camera matrix. You may have to swap the +/- over depending on whether you want the model to appear in front or behind the screen.