Skip to main content
Up and Coming
August 2, 2014

Getting IR Camera Transform

Just curious if anyone's poked around and found a way to get the transform for the IR camera in worldspace? It's the sort of thing that would be quite nice to have, similar to the way you can enable camera bounds in the demo scene, to help inform the player of the bounds of their movement.
    This topic has been closed for replies.

    26 replies

    Meta Employee
    August 28, 2014
    Hey guys,

    Just letting you know that we are working on improving the unity integration to support this. You shouldn't have to workaround this for too much longer.

    Thanks!
    Up and Coming
    September 2, 2014
    Hey, thanks a lot for this!

    Is there an easy way to make this take player eye height into account? The cone always seems to point at the OVRCameraController, but if I have Use Player Eye Height enabled the actual eye cameras move somewhere else entirely.
    BLACKISH (Games) | GameAssets.net (Assets)
    New Participant
    January 8, 2015
    Is there an updated version of this method? As far as i can see the method proposed by 9of9 uses deprecated code references.

    As i understand it on the newest version of the SDK (0.4.4) the OVRVisionGuide class should be able to do something similar, but i can't seem to get it to function for some reason.
    Inspiring
    January 8, 2015
    Since 0.4.3, we've exposed OVRManager.tracker.GetPose(). It returns the current IR camera pose in OVRCameraRig's local space.
    Participant
    January 17, 2015
    I updated the code for my project.
    https://gist.github.com/shole/5c96c95a5ac93f31fa57
    The camera refines it's position continuously after hmd reset and is often inaccurate right after, so I added a timed update polling as well.
    it's not pretty code, and apparently gist somehow messed up indentations, but it's a working starting point if you want it.
    Participant
    February 24, 2015
    Hey thanks for this, it is sort of working on the bottom of the cone. how can I get the whole frame of the cone to show up like in the demo scene?
    Participant
    February 26, 2015
    How can I make the view Cone Mesh a viewable wireframe mesh in the game?
    Up and Coming
    May 11, 2015
    How would this work with the latest unity integration?
    Inspiring
    May 11, 2015
    You can do this, but you'll have to do some calculation yourself.

    Basically, you call OVRManager.tracker.frustum and use nearZ, farZ, and fov. Then you have to use GetPose along with the frustum shape parameters to set up points in 3d space and then draw lines between them using LineRenderer.

    I've put in a feature request to make this a little easier in the API.
    AMD Ryzen 7 1800X | MSI X370 Titanium | G.Skill 16GB DDR4 3200 | EVGA SuperNOVA 1000 | Corsair Hydro H110i Gigabyte RX Vega 64 x2 | Samsung 960 Evo M.2 500GB | Seagate FireCuda SSHD 2TB | Phanteks ENTHOO EVOLV
    Up and Coming
    May 18, 2015
    And with Unity Beta 5.1 where there is no OVR reference files anymore?