0

I am trying to apply perturbations to user view in VR for an experimental system. What I am trying to do is that regardless of the direction the user looks at, I want to rotate his/her view in x direction. Unfortunately applying transform.Rotate() or changes on transform.localEulerAngles does not work directly on a VR camera object and I should use an empty parent object and attache a script to that. The problem with that is the rotation on x would just rotate the parent object and changes the vr view accordingly which is not the case I want. Would anybody know a solution?

  • when you say "rotate his/her view in x direction" do you mean doing a [yaw](https://i.imgur.com/3PbJ1eA.png) rotation (rotating around the y axis) or a pitch rotation (rotating around the x axis)? – Ruzihm May 20 '19 at 19:34
  • Also, can you explain a bit more about why you don't want to rotate the empty parent object? You say you don't want to change the vr view, but that seems like the whole point of the question. – Ruzihm May 20 '19 at 19:37
  • parenting a camera and moving the parent seems to be an only sensible way, why doesn't it work for you? – zambari May 21 '19 at 07:12
  • @Ruzihm: any direction. yaw or pitch. The problem is with rotations. – Abolfazl Mohebbi May 21 '19 at 20:49
  • @Ruzihm: to be specific we have 3 different frames(coordinates) here: 1)The real-time coordinate coming from trackers, 2)The local coordinate of the camera, 3)Coordinate of the empty object. If you rotate the (3) then the user-view does not change according to (1). Hence whichever direction you are facing, the rotation is happening around the X (or Y or Z) of the frame (3). Which is undesirable in my case. – Abolfazl Mohebbi May 21 '19 at 20:51
  • @zambari : please refer to my comments above. – Abolfazl Mohebbi May 21 '19 at 20:54
  • @Abolfazl So if the user rotates their head 1 degree to the left, and the game rotates her view 1 degrees to the left, what should be the outcome? If the user looks 1 degree to the right and the game rotates the view to the left 3 degrees, should this be the same outcome as the first case? If so, just rotating the empty object by 1 or 3 degrees to the left would have this effect. It would help if you described exactly how the outcome would be different between rotating the empty object from what you want. Have you tried doing it? – Ruzihm May 21 '19 at 21:10
  • @abolfazlmohebbi I am sorry it is not clear what you want to achieve and how what you are getting is different. we all know rotations can be a royal pain (positions are trivial), but the assumption in VR is that you don't, ever, control the camera directly, as it is effectively an external signal (created via tracking system), and whatever you want to do with the camera, you need to treat it as enclosed in a box - move the box, not the camera – zambari May 22 '19 at 09:43

0 Answers0