【发布时间】:2022-08-18 15:31:58
【问题描述】:
我在 SwiftUI 中显示一个 3D 对象,但在使对象的背景清晰时出现问题。我已经搜索并没有找到任何解决方案。有什么解决办法吗?
private var scene: SCNScene? {
SCNScene(named: \"Globe.scnassets/sphere.scn\")
}
private var cameraNode: SCNNode? {
let cameraNode = SCNNode()
cameraNode.camera = SCNCamera()
cameraNode.position = SCNVector3(x: 0, y: 0, z: 5)
return cameraNode
}
var body: some View {
SceneView(scene: scene,
pointOfView: cameraNode,
options: [.allowsCameraControl, .autoenablesDefaultLighting])
}
-
你试过这个吗? sceneView.backgroundColor = UIColor.clear
-
@ZAY 我的问题是关于 SwiftUI