Collada 文件在 scenekit 中显示不清晰

Collada file not show clear in scenekit

  1. 我已经在 xcode 中导入了我的 3d 隧道的 collada 文件。

2.when 我 运行 我的示例项目它显示 3d 隧道又远又小

class GameViewController: UIViewController {

override func viewDidLoad() {
    super.viewDidLoad()

    // create a new scene
    let scene = SCNScene(named: "art.scnassets/tube.dae")!

    // create and add a camera to the scene
    let cameraNode = SCNNode()
    cameraNode.camera = SCNCamera()
    scene.rootNode.addChildNode(cameraNode)

    // place the camera
    cameraNode.position = SCNVector3(x: 0, y: 0, z: 15)

    // create and add a light to the scene
    let lightNode = SCNNode()
    lightNode.light = SCNLight()
    lightNode.light!.type = SCNLightTypeOmni
    lightNode.position = SCNVector3(x: 0, y: 10, z: 10)
    scene.rootNode.addChildNode(lightNode)
  1. 我只是在 xcode 默认船舶代码中导入我的 collada 3d 对象 我应该怎么做才能看到靠近场景的 3d 隧道,如下图所示 在搅拌机中:

  1. 当我 运行 SceneKit 项目时,模拟器中的隧道看起来像这样:

[2

5.How 我能否在 scenekit 中获得与在 blender 中相同的 3d 隧道视图。

您的 Collada 文件中是否已有相机,即您用于生成第一个渲染图的相机?

如果是,找到 camera/node (childNodeWithName)。将其指定为您的观点。不要在代码中创建新相机。

或者,如果您确实需要创建一个新相机,请将其放在与第一次渲染所用视点相同的位置。