Stereo Questions

New Message Reply Date view Thread view Subject view Author view

Bruce Cameron (bmc++at++autobahn.mayo.EDU)
Fri, 23 Sep 94 15:23:32 CDT


Part of my continuing quest to understand stereo as
it relates to performer...

I have an existing application that I'd like to add
stereo on-the-fly to (i.e. press F2 to for stereo/mono).

My first attempt to do this was to create an addition
set of channels:

for (i = 0; i < NumChans; i++) {
        left[i] = pfNewChan (pfGetPipe(0));
        pfChanViewport (left[i], 0.0f, 1.0f, 0.0f, 0.5f);
        right[i] = pfNewChan (pfGetPipe(0));
        pfChanViewport (right[i], 0.1f, 1.0f, 0.5f, 1.0f);
        pfAttachChan (left[i], right[i]);
}
oldMaster = left[ChanOrder[(NumChans -1 ) >> 1]];

for (i = 0; i < NumChans; i++) {
        pfSetVec3 (hpr, (((NumChans - 1)*0.5f) - i)*fov, 0.0f, 0.0f);
             
        pfSetVec3 (xyz, -ioc, 0.0f, 0.0f);
        pfChanViewOffsets(left[ChanOrder[i]], xyz, hpr);
        pfChanAutoAspect (left[ChanOrder[i]], PFFRUST_CALC_VERT);
        pfMakePerspFrust (left[ChanOrder[i]], -x+ioc, x+ioc, -x, -x);
             
        pfSetVec3 (xyz, -ioc, 0.0f, 0.0f);
        pfChanViewOffsets(right[ChanOrder[i]], xyz, hpr);
        pfChanAutoAspect (right[ChanOrder[i]], PFFRUST_CALC_VERT);
        pfMakePerspFrust (right[ChanOrder[i]], -x-ioc, x-ioc, -x, -x);
}

Then to swap the ViewState->masterChan at the keystroke to swap
between stereo and mono while using setmonitor to change monitor
modes.

    tmp = oldMaster;
    oldMaster = ViewState->masterChan;
    ViewState->masterChan = oldMaster;

This fails to produce the desired results. Any clues as to how
to get stereo from performer on the fly?

I've looked at sfly, but it requires the graphics to be left
in a "stereo" mode. Any hints as to how to modify this to
be on-demand?


New Message Reply Date view Thread view Subject view Author view

This archive was generated by hypermail 2.0b2 on Mon Aug 10 1998 - 17:50:33 PDT

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