Two Channel Stereo

New Message Reply Date view Thread view Subject view Author view

Steve Woolsey (woolsr++at++inel.gov)
Tue, 10 Nov 1998 17:06:08 -0700


Hi,

I have created a program for an n-Vision HMD. Each eye is a seperate
channel coming off of the same pipe of an Onyx 2.

I have made the left channel the master, and attached the right channel
to it. Sharing the view, scene, draw and cull functions, and the
earthsky. The problem is that when I move, only one of the channels
updated the scene. Both update the earthsky model. I am updating my
view for the left channel only since both channels are sharing the
view. If I am sharing the scene and view, shouldn't both channels
update when I do movement? Any ideas what I am doing wrong?

Here is my Channel initializeation code:

void InitChannels()
{
        float near, far, Iod, converge;
        pfVec3 hprOffsets, xyzOffsets;
        int xSize, ySize;
        Iod = 2.0f; converge = 0.2f;
        near = 1.0f; far = Shared->far+7000.0f;
        Shared->left = new pfChannel(pfGetPipe(0));
        Shared->right = new pfChannel(pfGetPipe(0));
        Shared->left->setScene(Shared->scene);
        Shared->right->setScene(Shared->scene);
        pfSphere bsphere;
        Shared->scene->getBound(&bsphere);
        Shared->left->setNearFar(near, far);
        Shared->near = near;
        Shared->far = far;
        Shared->left->setFOV(45.0f, 0.0f);
        Shared->left->attach(Shared->right);
        uint mask = Shared->left->getShare();
        mask |= PFCHAN_SCENE | PFCHAN_DRAWFUNC | PFCHAN_CULLFUNC |
PFCHAN_STATS_DRAWMODE
| PFCHAN_EARTHSKY;
        Shared->left->setShare(mask);

        // Set CULL and DRAW functions
        Shared->left->setTravFunc(PFTRAV_CULL, CullChannel);
        Shared->left->setTravFunc(PFTRAV_DRAW, DrawChannel);

        // Set up offsets for left and right channels for stereo viewing

        float eyeAngle = PF_RAD2DEG(atanf(Iod*0.5f /
(converge*(far-near)+near)));
        Shared->pw->getSize(&xSize, &ySize);
        Shared->left->setViewport(0, xSize/xSize, 0,
((float(ySize)/2)-1)/ySize);
        Shared->right->setViewport(0,xSize/xSize,(float(ySize)/2)/ySize,
ySize/ySize);
        Shared->left->setView(Shared->view.xyz, Shared->view.hpr);

        // Initialize EarthSky, fog, and sun model
        InitEnviroment();

        // left eye
        hprOffsets.set(-eyeAngle, 0.0f, 0.0f);
        xyzOffsets.set(-Iod/2.0f, 0.0f, 0.0f);
        Shared->left->setViewOffsets(xyzOffsets, hprOffsets);

        // right eye
        hprOffsets.set(eyeAngle, 0.0f, 0.0f);
        xyzOffsets.set(Iod/2.0f, 0.0f, 0.0f);
        Shared->right->setViewOffsets(xyzOffsets, hprOffsets);

}

Thanks,

Steve

-------------------------------------------------------------------
Steven Woolsey Associate Engineer/Scientist
Lockheed Martin Idaho Technologies Visualization Engineer
Idaho National Engineering Lab. EMAIL: woolsr++at++inel.gov
P.O. Box 1625, M.S. 3605
Idaho Falls, ID 83415-3605
-------------------------------------------------------------------


New Message Reply Date view Thread view Subject view Author view

This archive was generated by hypermail 2.0b2 on Tue Nov 10 1998 - 16:06:48 PST

This message has been cleansed for anti-spam protection. Replace '++at++' in any mail addresses with the '@' symbol.