Netvr Posted August 13, 2018 Share Posted August 13, 2018 Request: Would you please change a privacy settings for OnChangeEyeCallback listeners to public in WaveVR_CanvasEye class. Otherwise I couldn't see any normal way to get left and right eye's cameras. A goal is to get a position of object in camera's coordinates and to put there a canvas with text. Link to comment Share on other sites More sharing options...
Tony PH Lin Posted August 14, 2018 Share Posted August 14, 2018 Are you trying to get the instances of eyes’ camera? You can try below: WaveVR_Render.Instance.lefteye.transform.position & WaveVR_Render.Instance.righteye.transform.position should be able to get the eyes’ positions. Link to comment Share on other sites More sharing options...
Netvr Posted August 15, 2018 Author Share Posted August 15, 2018 Anyway this instances is should be getting when the camera is changing from left to right (method WaveVR_CanvasEye.changeEye() is runing) I try to get position of object on screen by this part of script, and result is not correct. void LateUpdate() { Camera lefteyeCamera = WaveVR_Render.Instance.lefteye.transform.GetComponent<Camera>(); Vector3 pos = lefteyeCamera.WorldToScreenPoint(targetPosition) } Link to comment Share on other sites More sharing options...
Tony PH Lin Posted August 16, 2018 Share Posted August 16, 2018 Since the camera position changes over time, you could listen WaveVR_Utils.Event.AFTER_NEW_POSES to correct the position. void Start () { WaveVR_Utils.Event.Listen(WaveVR_Utils.Event.AFTER_NEW_POSES, OnAfterNewPoses); } void OnAfterNewPoses(params object[] args) { Camera lefteyeCamera = WaveVR_Render.Instance.lefteye.transform.GetComponent<Camera>(); Vector3 pos = lefteyeCamera.WorldToScreenPoint(transform.position); } Link to comment Share on other sites More sharing options...
Netvr Posted August 17, 2018 Author Share Posted August 17, 2018 No, unfortunately it's not getting correct result. Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.