PTB-OpenGL 立体渲染和眼睛分离值

问题描述

我尝试使用 OpenGL 非对称平截头体平行轴投影绘制 3D 点云。一般原则可以在这个网站上找到(http://paulbourke.net/stereographics/stereorender/#)。但是现在的问题是,当我使用真正的眼睛分离(0.06m)时,我的眼睛不能很好地融合。使用眼距=1/30*焦距时,没有压力。不知道是计算有问题,还是参数有问题?部分代码贴在下面。谢谢大家。

for view = 0:stereoViews
    % Select 'view' to render (left- or  right-eye):
    Screen('SelectStereoDrawbuffer',win,view);

    % Manually reenable 3D mode in  preparation of eye draw cycle:
    Screen('BeginopenGL',win);

    % Set the eye seperation:
    eye = 0.06; % in meter

    % Caculate the frustum shift at the near plane:
    fshift = 0.5 * eye *  depthrangen/(vdist/100);  % vdist is the focal length,56cm,0.56m
    right_near = depthrangen *  tand(FOV/2); % depthrangen is the depth of the near plane,0.4. %FOV is the field of view,18°
    left_near = -right_near;
    top_near = right_near* aspectr;
    bottom_near = -top_near;

    % Setup frustum projection for this  eyes 'view':
    glMatrixMode(GL.PROJECTION)
    glLoadIdentity;
    eyeside = 1+(-2*view); % 1 for left eye,-1 for right eye
    glFrustum(left_near + eyeside *  fshift,right_near + eyeside * fshift,bottom_near,top_near,%depthrangen,depthrangefObj);         

    % Setup camera for this eyes 'view':
    glMatrixMode(GL.MODELVIEW);
    glLoadIdentity;
    gluLookAt(0 - eyeside * 0.5 * eye,0 - eyeside * 0.5 * eye,-1,1,0);
    
    % Clear color and depths buffers:
    glClear;
    moglDrawDots3D(win,xyz(:,:,iframe),10,[],1);
    moglDrawDots3D(win,xyzObj(:,1);

    % Manually disable 3D mode before  calling Screen('Flip')!
    Screen('EndOpenGL',win);
    % Repeat for other eyes view if in stereo presentation mode...
end

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)