I need to change the WikitudeCamera Aspect ratio to fit inside a video box (small box inside the screen), but didn't work using the WikitudeCamera inside a RectTransform with anchors.
I found in the documentations that "The WikitudeCamera prefab takes care about rendering the live camera stream fullscreen behind all your augmentations."
I'm using the Input Plugins API to supply the frame data.
So, I wonder if it is possible to resize it and how do it.
is there still a problem with displaying the camera render textures or is the input/placement mechanics not working properly? I just tried out the code for the scene picking controller and I found that it can't be working. The RawImage's rect position will not deliver the world position but the local position, which was wrong for the calculation. The following adjustments to the code did the trick for me:
Vector3 v = new Vector3; ARCameraRawImage.rectTransform.GetWorldCorners(v); adjustedPosition.x = (Input.mousePosition.x - v.x) * (Screen.width / (v.x - v.x)); adjustedPosition.y = (Input.mousePosition.y - v.y) * (Screen.height / (v.y - v.y)); adjustedPosition.z = Input.mousePosition.z;
Note: ARCameraRawImage is actually ARCameraRT from before (which was not well named back then).
Here is a link to the GetWorldCorners() method documentation from Unity. This method delivers all 4 world corners for any UI element and this then can be used to properly do the adjustment calculations (which formerly delivered wrong results and therefore wrong positioning).
Great! Works like a charm!