Unity Maincamera angle difference

0 votes
asked Jul 10, 2015 by Houzangbe Samory (167 points)
edited May 17, 2016 by ijonathanharper@gmail.com
Hello everyone,

So here lies my problem. I have a hard time understanding the ZSCore camera orientation.

Let's say I have a MainCamera with no rotation at all (only the positions are changed) and a ZSCore as a child component to this Camera. The ZSCore is at default value (0,0,0). My MainCamera is looking straight at what I want it to look at, but when I launch my program the ZSCore cameras have now a different X rotation, meaning that I am now looking Up and not straight to my object.

After some test I have found some values that suits my scene but still I have no written evidence that what I am doing is good or if it'll work with other situations.

So is there a official configuration or information on the subject?

Thanks in advance.

1 Answer

0 votes
answered Jul 10, 2015 by (335 points)
selected Jul 17, 2015 by Houzangbe Samory
Best answer
There is a downloadable VR application, a tutorial, to explain how the stereo cameras behave. Can you take a look then come back with questions?

commented Jul 15, 2015 by Houzangbe Samory (167 points)
Hello Riaz,
Sorry for the late answer.
So I already downloaded the stereo tutorial and understood most of the principles in it.
But the stereo is not the problem I have. My problem lies in the orientation of the ZSCore camera.
Let's say I have a camera at the origin and a ZSCore linked to this camera. When I launch the program my MainCamera angle will still be (0,0,0) while my ZSCore Camera (left and right cameras) angle will be (332.3604, 0, 0).
Where is that 332 value come from? Is it documented somewhere?
commented Jul 15, 2015 by dtwilleagerinfinitez-com (275 points)
Hello Houzangbe,

The orientations that you see in the ZSCore camera's are used to move the main camera from camera space to viewport space before applying the off-axis projection.  This orientation (and the position offset) can change dynamically depending on the orientation of the display as well as the position of the window on the screen.  These coordinate systems can be seen in the zSpace Coordinate Systems document in the docs area.  That will explain the math being used, but a higher level description may help you visualize what is happening.

The camera space direction (defined by your main camera) will  be pointing at the center of the zSpace display.  The display defines the zero parallax plane where no stereo separation occurs.  This display plane defines a "portal" into your scene.  As the main camera moves around, the display plane/portal moves around with it.  This plane will always be the length of the "camera offset" vector units away from the main camera.  The reason that these are not fixed values is because in our newer displays, the values can change dynamically, and we use the cameras in the ZSCore camera rig to compensate for the display angle and window viewport.

Let me know if this helps you visualize what's happening.

commented Jul 16, 2015 by Houzangbe Samory (167 points)
Hello Doug,

Ok I think I got how it is working.
On a related topic I'm wondering if it is possible to update the orientation of the ZSCore Camera while the screen is moving during the application? The problem being that the camera orientation is calculated only at the begining of the application and thus not updating with the position of the screen. Other than moving the referenced camera I imply.

Thank you for your time and help. I now grasp the concept more.

commented Jul 16, 2015 by dtwilleagerinfinitez-com (275 points)
There is an API in ZSCore that can enable dynamic screen changes.  Simply add the following in your initialization code:

ZSCore core = GameObject.FindObjectOfType(typeof(ZSCore)) as ZSCore;

and it will track screen orientation changes.  Note that this only works on the zSpace 200 system, and not the zSpace 100 system.

commented Jul 17, 2015 by Houzangbe Samory (167 points)
Ok I get it now. Thanks a lot Doug.
It works fine now. I need to polish some things but I get the result I wanted.
Thanks a lot.