How to swap camera orientation?

0 votes
asked Jan 29 by scitechdev (310 points)
Hi, I'm looking to get the camera to run in portrait mode.

Is this possible?

2 Answers

–1 vote
answered Jan 30 by bigbaak (720 points)
Hello, scitechdev.

You can fixed screen orientation on Unity3D Build Settings -> Player Settings -> Tab "Resolution and Presentation"-> Orientation .  Camera orientation depends of screen orientation.
commented Jan 30 by scitechdev (310 points)
Hey, bigbaak, am I blind or is it not here? https://imgur.com/a/7gBuOE4
0 votes
answered Jan 30 by kenn (7,610 points)
If you mean the camera image rendered as background, then all samples are already working in the right way for all screen orientations.

If you mean the camera image data (CPU byte array), then it is a hardware level question. I will leave the details to google, it will take you to some thread like https://stackoverflow.com/questions/14066038
commented Jan 30 by scitechdev (310 points)
I think the camera image displayed, and its not correct for all orientations.

On PC, I have to rotate my whole monitor to the side to get the correct camera view.
commented Jan 31 by kenn (7,610 points)
Are you using some special development hardware or system settings or are you targeting such devices?
We did not handle orientations on PC in our samples and Unity plugin. They are well tested on Android and iOS devices though.
If you have to make it work, you can reference some code for mobile conditions, like Display.cs of Unity plugin.
commented Feb 2 by scitechdev (310 points)
I'm targeting PC.
When the monitor is on it's side (portrait mode essentially) and the camera is on its side, I need to rotate the rendered video so that it's not displaying a landscape video feed on a portrait view.
commented Feb 2 by kenn (7,610 points)
I see. It's easier to handle a special target device than all possible devices, because you never know how the camera is placed on PC when connecting a USB cable. Change Rotation.Get in Display.cs to return 90 or 270, it should work.
commented Feb 3 by scitechdev (310 points)
It changed the orientation but now the 3D model is tracking the opposite of what it's supposed to be.
And for the type of software I'm developing, everything is in a controlled environment and needs to be specifically set up.
Welcome to EasyAR SDK Q&A, where you can ask questions and receive answers from other members of the community.
...