Forum Discussion
seanarvr
8 years agoHonored Guest
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
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
2 Replies
Replies have been turned off for this discussion
- seanarvrHonored Guest
This is a PC project.
imperativity said:
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();
} - seanarvrHonored Guest
imperativity said:
@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/
Quick Links
- Horizon Developer Support
- Quest User Forums
- Troubleshooting Forum for problems with a game or app
- Quest Support for problems with your device
Other Meta Support
Related Content
- 6 months ago