Forum Discussion

🚨 This forum is archived and read-only. To submit a forum post, please visit our new Developer Forum. 🚨
Fiore's avatar
Fiore
Honored Guest
12 years ago

Anaglyph to test depth sans Rift

While waiting for my Rift, I started testing some ideas that may or may not work once my Rift arives. Has anyone tried to take the SDK and output an anaglyph singnal from the Unity/Oculus camera prefab?

2 Replies

Replies have been turned off for this discussion
  • drash's avatar
    drash
    Heroic Explorer
    I went for a while without a Rift, and I basically had my project set up to show something that could be viewed by crossing my eyes when I wanted to check 3D stuff. To do that, I just needed to make a small change to UpdateCameras() in OVRCameraController.cs.

    Replace your UpdateCameras() method (in 0.2.2 Unity Integration) with this:

    	
    public bool CrossEyed = false;

    // InitCameras
    void UpdateCameras()
    {
    // Values that influence the stereo camera orientation up and above the tracker
    if(FollowOrientation != null)
    OrientationOffset = FollowOrientation.rotation;

    if(UpdateCamerasDirtyFlag == false)
    return;

    float distOffset = 0.5f + (LensOffsetLeft * 0.5f);
    float perspOffset = LensOffsetLeft;
    float eyePositionOffset = -IPD * 0.5f;

    if(!CrossEyed)
    ConfigureCamera(ref CameraLeft, distOffset, perspOffset, eyePositionOffset);
    else
    ConfigureCamera(ref CameraRight, distOffset, perspOffset, eyePositionOffset);

    distOffset = 0.5f + (LensOffsetRight * 0.5f);
    perspOffset = LensOffsetRight;
    eyePositionOffset = IPD * 0.5f;

    if(!CrossEyed)
    ConfigureCamera(ref CameraRight, distOffset, perspOffset, eyePositionOffset);
    else
    ConfigureCamera(ref CameraLeft, distOffset, perspOffset, eyePositionOffset);

    UpdateCamerasDirtyFlag = false;
    }


    By adding the public boolean variable, you can have some other script set the OVRCameraController's CrossEyed value to turn it on or off or something. There's no substitute for actually seeing the scale of things in the Rift though! Just remember to set it back to false when you get your Rift. :)
  • Fiore's avatar
    Fiore
    Honored Guest
    Thank you, i will try it today. I also realized that I could use a Pokescope viewer... If I could remember where I put it.