How to swap camera orientation?

0 votes
asked Jan 29, 2020 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, 2020 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, 2020 by scitechdev (310 points)
Hey, bigbaak, am I blind or is it not here?
0 votes
answered Jan 30, 2020 by kenn (18,750 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
commented Jan 30, 2020 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, 2020 by kenn (18,750 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, 2020 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, 2020 by kenn (18,750 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, 2020 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.