问题描述
我一直在寻找ARKit(特别是ARSCNView)在所有设备上都显示相同的屏幕/视图/场景大小的答案.我只有一部iPhone XS,所以无法在其他设备上测试我的ARKit应用.
当前,我将其与SpriteKit中的SKScene叠加在一起,并且在SpriteKit中,所有设备都在2种不同的尺寸上运行.
通过打印语句,我已经能够使用前置摄像头找到它,从而将我的脸显示在屏幕上,并在其上面覆盖一个SKScene,屏幕/视图/场景/等的大小为 375x812 .
有人碰巧知道所有设备是否都使用ARKit + SpriteKit覆盖物呈现相同的尺寸?
当然,不同的iPhone型号具有不同的分辨率.iPhone的屏幕尺寸
和视口尺寸
之间有很大的差异.看这张桌子.在某些情况下,视口大小
是屏幕大小
的1/9,有时是1/4.不过,某些型号的屏幕尺寸
和视口尺寸
.
| ------------------------ | ----------------- |----------------- ||<设备>|<屏幕尺寸>|<视口大小>|| ------------------------ | ----------------- | ----------------- || ------------------------ | ----------------- | ----------------- ||iPhone 12 Pro Max |1284 x 2778 |428 x 926 || ------------------------ | ----------------- | ----------------- ||iPhone X |1125 x 2436 |375 x 812 || ------------------------ | ----------------- | ----------------- ||iPhone SE 2 |750 x 1334 |375 x 667 || ------------------------ | ----------------- | ----------------- ||iPhone 8 Plus |1080 x 1920 |414 x 736 || ------------------------ | ----------------- | ----------------- ||iPhone 6s |750 x 1334 |375 x 667 || ------------------------ | ----------------- | ----------------- |
有关更多详细信息,您可以阅读这篇SO帖子.
本指南为您提供了直观的表示./p>
I've been looking for an answer to whether ARKit, specifically ARSCNView, shows the same screen/view/scene size on all devices. I only have an iPhone XS so I am unable to test my ARKit app on other devices.
Currently I am overlaying it with an SKScene from SpriteKit, and in SpriteKit there are 2 different sizes all devices run on.
Through print statements I've been able to find that with the front-facing camera, thus presenting my face on-screen, and overlaying it with an SKScene, that the size of the screen/view/scene/etcetc is 375x812.
Does anyone happen to know if all devices present the same size with ARKit + SpriteKit overlay?
Of course different iPhone models present different resolutions. There's a big difference between iPhone's screen size
and viewport size
. Look at this table. In some cases viewport size
is 1/9 of screen size
, sometimes – 1/4. Though, some models have identical screen size
and viewport size
.
|------------------------|-----------------|-----------------|
| <Device> | <Screen Size> | <Viewport Size> |
|------------------------|-----------------|-----------------|
|------------------------|-----------------|-----------------|
| iPhone 12 Pro Max | 1284 x 2778 | 428 x 926 |
|------------------------|-----------------|-----------------|
| iPhone X | 1125 x 2436 | 375 x 812 |
|------------------------|-----------------|-----------------|
| iPhone SE 2 | 750 x 1334 | 375 x 667 |
|------------------------|-----------------|-----------------|
| iPhone 8 Plus | 1080 x 1920 | 414 x 736 |
|------------------------|-----------------|-----------------|
| iPhone 6s | 750 x 1334 | 375 x 667 |
|------------------------|-----------------|-----------------|
For more details, you can read this SO post.
This guide gives you a visual representation.
这篇关于不同iPhone上的ARKit的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!