0

苹果文档_

func projectPoint(_ point: simd_float3, orientation: UIInterfaceOrientation, viewportSize: CGSize) -> CGPoint

说:

视口尺寸

将在其中显示相机图像的视图的大小(以磅为单位)。

我不清楚要呈现相机图像的视图是什么意思?这是否意味着我应该为viewportSize输入屏幕尺寸?

let screenDimensions = UIScreen.main.bounds.size
let position = node.position

camera.projectPoint(simd_float3(position), orientation: .portrait, viewportSize: screenDimensions)
4

1 回答 1

0

我刚刚注意到链接还说:

返回值

指定点在二维像素坐标空间中的投影,其原点左上角其大小与 viewportSize 参数的大小匹配

这表明你可以放任何你想要的尺寸。如果需要,屏幕尺寸就足够了。

于 2020-12-31T20:07:33.147 回答