Forum Discussion
Altavere
13 years agoHonored Guest
[Solved] Help needed for camera orientation offset
Hi there,
In a project I’m working on, the player is a spectator who looks at the world below him. All works fine but after a while my neck starts to hurt from constantly looking down… :?
So I thought it would be better if I could watch a bit more straight forward but still see the same as if I was looking down.
I have practically zero programming skills but I’ve managed to rotate the cameras (30 degrees) in the OVR scripts. The result is satisfying and when I look around using the mouse, it works the way I want it to (I use the OVRPlayerController prefab). But when I start looking around by rotating my head, it goes predictably wrong. I guess it has something to do with the fact that I’m not rotating the cameras in world space or something? It would be nice if the result of rotating my head would be the same as moving the mouse. That way the perceived horizon would stay horizontal.
I’ve been trying for several days now without any luck, so I was hoping if you guys could help me out with this. Is there a relatively simple solution that a noob like me can understand or is this higher maths stuff?
Thanks in advance!
In a project I’m working on, the player is a spectator who looks at the world below him. All works fine but after a while my neck starts to hurt from constantly looking down… :?
So I thought it would be better if I could watch a bit more straight forward but still see the same as if I was looking down.
I have practically zero programming skills but I’ve managed to rotate the cameras (30 degrees) in the OVR scripts. The result is satisfying and when I look around using the mouse, it works the way I want it to (I use the OVRPlayerController prefab). But when I start looking around by rotating my head, it goes predictably wrong. I guess it has something to do with the fact that I’m not rotating the cameras in world space or something? It would be nice if the result of rotating my head would be the same as moving the mouse. That way the perceived horizon would stay horizontal.
I’ve been trying for several days now without any luck, so I was hoping if you guys could help me out with this. Is there a relatively simple solution that a noob like me can understand or is this higher maths stuff?
Thanks in advance!
10 Replies
Replies have been turned off for this discussion
- XswampyXHonored GuestHave you thought about rotating your world?
- boone188Honored GuestYou don't need to do any math or programming for this. Here is what you should try:
1. Create a game object called "Player" or something
2. Rotate the game object to look down, by setting the X rotation to -30 degrees or something
3. Add an OVRCameraController as a child of your "Player" object
4. Find the "Follow Orientation" field in the OVRCameraController. Drag your "Player" object into that field.
The orientation of your camera should now follow the orientation of your "Player" object, so it will be looking down. - AltavereHonored Guest
"XswampyX" wrote:
Have you thought about rotating your world?
I did, but as you can imagine, this will result in even more problems as soon as you start looking around. - AltavereHonored Guest
"boone188" wrote:
You don't need to do any math or programming for this. Here is what you should try:
1. Create a game object called "Player" or something
2. Rotate the game object to look down, by setting the X rotation to -30 degrees or something
3. Add an OVRCameraController as a child of your "Player" object
4. Find the "Follow Orientation" field in the OVRCameraController. Drag your "Player" object into that field.
The orientation of your camera should now follow the orientation of your "Player" object, so it will be looking down.
Okay, that's indeed way more easy than I did with scripting but the result is the same: the camera is looking down but rotating the head still results in a tilting horizon. - boone188Honored Guest
"Altavere" wrote:
"boone188" wrote:
You don't need to do any math or programming for this. Here is what you should try:
1. Create a game object called "Player" or something
2. Rotate the game object to look down, by setting the X rotation to -30 degrees or something
3. Add an OVRCameraController as a child of your "Player" object
4. Find the "Follow Orientation" field in the OVRCameraController. Drag your "Player" object into that field.
The orientation of your camera should now follow the orientation of your "Player" object, so it will be looking down.
Okay, that's indeed way more easy than I did with scripting but the result is the same: the camera is looking down but rotating the head still results in a tilting horizon.
Have you made sure that any changes you made to the OVR scripts have been reverted? Try re-importing the package. - AltavereHonored GuestYes I did, the scripts are clean without my code :D
Have you tried it yourself boone188? Did it work for you? - boone188Honored Guest
"Altavere" wrote:
Yes I did, the scripts are clean without my code :D
Have you tried it yourself boone188? Did it work for you?
Yeah I've done this sort of thing many times. Hmmm.. Try setting "Tracker Rotates Y" to false if it isn't already. - AltavereHonored Guest
"boone188" wrote:
Try setting "Tracker Rotates Y" to false if it isn't already.
Done that as well, it doesn't make a difference.
Now I've tried a different approach by placing a dummy object in-between the OVRCameraController and both camera's, then I gave both camera's an x rotation and moved the OVRCamera script to the dummies. This gives me the desired rotation/orientation effect as I turn my head but now I'm missing the lens correction and it looks like I've decreased performance...
Makes me think I'm almost there but I am not able to finish it, very frustrating :cry:
Any other suggestions on how to make it work? - AltavereHonored GuestI did it!
I just addedtransform.Rotate(30,0,0,Space.Self);
in the OVRCamera script and now it works! It only makes me a little dizzy as well :lol:.
It's kind of hard to explain what it looks like, but it works.
For an acceptable experience, I've now combined 10 degrees offset in the old way, with 20 degrees in the thing above. Makes 30 degrees of horizon offset.
Cheers - cyberealityGrand ChampionGreat! Thanks for posting the fix.
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
- 4 years ago
- 6 months ago