Skip to main content
New Participant
November 3, 2017

How to change centerEyeAnchor position and rotation

I have been trying to change centerEyeAnchor position and rotation. So I can use my own positional tracking data. 
Below are the codes I have:


void OnUpdatedAnchors(OVRCameraRig rig)
    {
        if (!enabled)
            return;

        //these two lines are used to obtain positional data from my tracking system
        centerEyePose.position = GetPos();
        centerEyePose.orientation = GetRotation();

        //This doesn't work because VR camera poses are read-only.
        rig.centerEyeAnchor.FromOVRPose(centerEyePose, true);
        rig.leftEyeAnchor.FromOVRPose(centerEyePose, true);
        rig.rightEyeAnchor.FromOVRPose(centerEyePose, true);
}



I registered above codes to OVRCameraRig.UpdatedAnchors event
I was able to control  leftEyeAnchor & rightEyeAnchor, but centerEyeAnchor has no effect. 
Does anyone know how to modify centerEyeAnchor ? 
Please help 



    This topic has been closed for replies.

    2 replies

    seanarvrAuthor
    New Participant
    November 7, 2017


    Hi,

    This was previously answered in this forum post here. Is this a Gear VR or PC project?

    This is a PC project. 
    I read the post you attached.
    I have wrote and tested the following script, and attached to CenterEyeAnchor object, but it didn't work. the position still shown (0,0,0). What might be some possible mistakes I made ? FYI, I am using my own tracking devices. 

        protected virtual void LateUpdate()
        {
            if (rigidId < 0)
                return;
    //GetPos()function: get position data from my own motion capture tracking devices (opti-track)
            transform.localPosition = GetPos();

        }

    seanarvrAuthor
    New Participant
    November 8, 2017


    @seanarvr

    Regarding this:

    FYI, I am using my own tracking devices.
    Can you clarify this? This would go quite far in explaining why this is not working.


    I have Opti-Track motion tracking system 
    http://www.optitrack.com/