Awesome!! Thanks for the help Renato! That fixed both issues!!
I wonder when we will see Android support for this amazing feature. Fingers crossed.
Ok so, it fixed the issue of the distortion on the iPhones. It did not correct it for iPad. It appears that the ratio to avoid distortion on the iPad is nearly 2:1 So the box will need to be 2x as wide as it is tall. In order to cover the whole screen, you have to go well outside the bounds of the screen. The issue then is the camera feed becomes extremely zoomed in. I tried to use .fill.scaleX to scale the camera feed, but no luck. Anyone have any other ideas?
Thanks,
Scott
Is landscape camera feed supported yet?
Can you just rotate the object by 90 degrees in your app? Or do that for everything else on the screen. I did that before when I wrote a game in landscape but the rest of the app was portrait.
Warren
We definitely could do that, but if landscape is supported, Id rather not…
Ok did a test run in portrait… I should be able to make this work, but it is going to be a big pain to work with a sideways simulator…
So even in portrait mode I am getting distortion… the y axis appears stretched… what can I do about this?
Your shape (that you fill using Camera Feed) needs to be in the same aspect ratio of the camera, otherwise it will be stretched. The iOS cameras use a 4:3 ratio.
About the landscape, the code that I posted before works fine for landscape mode.
Awesome!! Thanks for the help Renato! That fixed both issues!!
I wonder when we will see Android support for this amazing feature. Fingers crossed.
Ok so, it fixed the issue of the distortion on the iPhones. It did not correct it for iPad. It appears that the ratio to avoid distortion on the iPad is nearly 2:1 So the box will need to be 2x as wide as it is tall. In order to cover the whole screen, you have to go well outside the bounds of the screen. The issue then is the camera feed becomes extremely zoomed in. I tried to use .fill.scaleX to scale the camera feed, but no luck. Anyone have any other ideas?
Thanks,
Scott
@ojnab - So trying to recall off the top of my head, but the ipad ration ended up being 16:9… so if your display.newRect is like 640x360 it will not case distortion. It appears to be using the iPads video capture ration and not its picture.
You can see the zoom difference when selecting video vs camera in the ipads camera app. The feed matches the feed on the video.
I could find no way to “zoom” the feed in… which was problematic for what I was doing… if anyone knows a way to zoom, it would be awesome as I am going back to that app soon.
Scott
Thanks.
To add to the confusion I just discovered that the back-facing camera on the iPad uses 16:9 ratio but the front-facing camera uses 4:3 ( same as iPhone ). So to avoid stretching - the ratio of the camera fill object needs to be changed when toggling between the cameras.
@ojnab - So trying to recall off the top of my head, but the ipad ration ended up being 16:9… so if your display.newRect is like 640x360 it will not case distortion. It appears to be using the iPads video capture ration and not its picture.
You can see the zoom difference when selecting video vs camera in the ipads camera app. The feed matches the feed on the video.
I could find no way to “zoom” the feed in… which was problematic for what I was doing… if anyone knows a way to zoom, it would be awesome as I am going back to that app soon.
Scott
Thanks.
To add to the confusion I just discovered that the back-facing camera on the iPad uses 16:9 ratio but the front-facing camera uses 4:3 ( same as iPhone ). So to avoid stretching - the ratio of the camera fill object needs to be changed when toggling between the cameras.