【发布时间】:2016-08-07 20:47:53
【问题描述】:
- 我已在 xcode 中导入了 3d 隧道的 collada 文件。
2.当我运行我的示例项目时,它显示的 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)
- 我只是在 xcode 默认船舶代码中导入我的 collada 3d 对象我应该怎么做才能看到我的 3d 隧道靠近现场,如下图所示 在搅拌机中:
- 当我运行 SceneKit 项目时,模拟器中的隧道如下所示:
[2
5.如何让我的 3d 隧道在场景包中获得与在搅拌机中相同的视图。
【问题讨论】: